Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
key error
#2
"time_period" is not a column in df. This is easy to test by printing "df" and looking at the columns. "time_period" will not be there. I don't know if this is because there is no time_period column, or if the string doesn't match ("time_period" does not match "time period" or "time_period ").

As far as I can tell, df.loc[df2['machine_status']==0]['time_period'] and df[df2['machine_status']==0]['time_period'] produce the same result.
Reply


Messages In This Thread
key error - by Led_Zeppelin - Aug-31-2022, 06:16 PM
RE: key error - by deanhystad - Aug-31-2022, 07:53 PM

Forum Jump:

User Panel Messages

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