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 [int64] array with a scalar of type [bool]

$
0
0

@rock_bt wrote:

Hey all,
I want to create a new column ,which is based on the two condition,

Can any one tell what is wrong with the code, and what is the right code.

Input:

Dataset[“Req_Qty”] = np.where(Dataset[“Type”]==“TAB” & Dataset[“Value”]>=100,“100” , “False”)

Error:

TypeError: cannot compare a dtyped [int64] array with a scalar of type [bool]

Thank You

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles