Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Plotting by Time, error
#1
Hi

Observing following error while plotting the series by time


Error:
TypeError: float() argument must be a string or a real number, not 'datetime.time'
tickets_df['Time']=tickets_df['book_date'].dt.time
x=tickets_df.groupby('Time')[['Time']].count()

plt.figure(figsize=(18,6))
plt.plot(x.index, x['Time'],marker="^")      # << giving me error on this line ---
plt.xlabel('Time', fontsize=20)
plt.ylabel('Number of Tickets', fontsize=20)
plt.grid('b')
plt.show()
buran write May-16-2023, 07:14 AM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Reply


Messages In This Thread
Plotting by Time, error - by mansoorahs - May-16-2023, 04:05 AM
RE: Plotting by Time, error - by Larz60+ - May-16-2023, 09:46 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Non-blocking real-time plotting slow_rider 5 7,979 Jan-07-2023, 09:47 PM
Last Post: woooee
Exclamation Error when plotting a graph. Oshadha 3 5,147 Mar-14-2022, 06:47 PM
Last Post: deanhystad
  time setup for realtime plotting of serial datas at high sampling rate alice93 6 5,926 Jan-07-2022, 05:41 PM
Last Post: deanhystad
  Plotting A Time Series With Shaded Recession Bars adamszymanski 1 3,746 Jan-24-2021, 09:08 PM
Last Post: nealc
  Time Limit Exceeded error loves 5 4,324 Dec-03-2020, 07:15 AM
Last Post: Sofia_Grace
  Time conversion error tester_V 1 2,551 Oct-28-2020, 10:48 PM
Last Post: tester_V
  Error When Plotting ValueError: x and y must have same first dimension JoeDainton123 1 10,134 Oct-04-2020, 12:58 PM
Last Post: scidam
  Read CSV error: python KeyError: 'Time' charlicruz 1 6,710 Jun-27-2020, 09:56 AM
Last Post: charlicruz
  save in CSV and plotting in real time linkxxx 8 7,446 Sep-01-2019, 12:24 PM
Last Post: buran
  Error when running the second time metro17 3 4,577 Aug-30-2019, 12:09 PM
Last Post: ThomasL

Forum Jump:

User Panel Messages

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