There is problem with user_date
values, because if use strings
get:
TypeError: Empty 'DataFrame': no numeric data to plot
One possible solution is convert them to ordered categorical and plot by cat.codes
.
Also plot timedelata is not implemented, so user_time
was converted to to_datetime
and then to string
s by strftime
:
days = ['Mon','Tue','Wed','Thu','Fri','Sat','Sun']
df['user_date'] = df['user_date'].astype('category', categories=days, ordered=True)
df['user_time1'] = pd.to_datetime(df['user_time']).dt.strftime('%H:%M:%S')
df['user_date1'] = df['user_date'].cat.codes
ax = df.plot(x='user_time1', y='user_date1')
#set max and min values of axis
#https://stackoverflow.com/a/43460067/2901002
ax.set_yticks(range(7))
ax.set_yticklabels(days)
