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

How to use Multiple Condition with Pandas DataFrame

$
0
0

@mohitlearns wrote:

Hello,

I have a small DataFrame object which has the following Features:

  1. Day
  2. Temperature
  3. WindSpeed
  4. Event (Sunny, Cloudy, Snow, Rain)

I want to list “Day” and “WIndSpeed” where “WindSpeed” >4 “OR” “Temperature” >30

I am using the following command to the execute the above condition, however, its misfiring.

df[["Day","WindSpeed"]] [df["WindSpeed"]>4 | df["Temperature"]>30] 

Can someone tell me what’s wrong with the above command?

I don’t want to use “.loc” or “.iloc”

Thanks
Mohit

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4448

Trending Articles