Quantcast
Channel: Data Science, Analytics and Big Data discussions - Latest topics
Viewing all articles
Browse latest Browse all 4448

Read a Specific Column from Excel in Python

$
0
0

@sachin123456 wrote:

Hi,

I have a function say

def excelsqrtfile(k):
  if(k>0):
    result = m.sqrt(x)
    print(result)
  else:
    result = 0
  return result

I need to apply this function to a specific column in Excel sheet.
I have a dataframe df

I am calling the function like below.

df1["sqr"]=excelsqrtfile(df1.dummy)

Error:
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

Any Help would be appreciated.

Thanks,

Posts: 6

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles