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

How to resolve:Python error: "cannot compare a dtyped [float64] array with a scalar of type [bool]"

$
0
0

@Aarshay wrote:

I'm facing a peculiar issue. I'm trying to filter a pandas dataframe using criteria across multiple columns.

Here is the code snipet:
data.loc[passID,"CoupleTravel"] = len(data_tckt[data_tckt["FamilyName"]==fn & data_tckt["Age"]<15] & data_tckt["Title"]==2)

I'm getting an error: cannot compare a dtyped [float64] array with a scalar of type [bool]

I'm not comparing any boolean variable here. Any help would be great!

Thanks,
Aarshay

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles