Python Forum
pd.query method question
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
pd.query method question
#4
In that case, you want to change the operator to "or":

df.query('col1 == "Feb" or col1 == "Mar"')
Any individual value in col1 cannot equal "Feb" and "Mar" simultaneously so "and" won't work.
Reply


Messages In This Thread
pd.query method question - by PolskaYBZ - Jan-24-2019, 07:48 PM
RE: pd.query method question - by stullis - Jan-24-2019, 07:59 PM
RE: pd.query method question - by PolskaYBZ - Jan-24-2019, 08:10 PM
RE: pd.query method question - by stullis - Jan-24-2019, 09:14 PM
RE: pd.query method question - by PolskaYBZ - Jan-25-2019, 10:33 AM
RE: pd.query method question - by stullis - Jan-25-2019, 08:23 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  PyCharm IDE: Method Not Showing Up Question: Bug or Feature? Oliver 2 3,794 Dec-04-2017, 11:54 AM
Last Post: Oliver
  Apply Method Question smw10c 4 5,630 Apr-08-2017, 12:47 PM
Last Post: smw10c
  value_counts method question smw10c 4 4,957 Mar-22-2017, 10:59 PM
Last Post: zivoni

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020