Hi I am working on a categorical data. I want to see device behavior on a given day. I have these as my dataframe:
On toronto_time
, I have a datetime64[D]
. I previously used dt.time
to remove the date. However, it presents a datatype problem which makes it a type object
and not datetime64[D]
. Converting it again with pd.to_datetime
will add a date on itself.
So I left it with the original:
toronto_time description
0 2018-09-08 00:00:50 STATS
1 2018-09-08 00:01:55 STATS
2 2018-09-08 00:02:18 DEV_OL
3 2018-09-08 00:05:24 STATS
4 2018-09-08 00:05:34 STATS
5 2018-09-08 00:06:33 CMD_ERROR
I tried plotting it with seaborn with these codes:
import matplotlib.pyplot as plt
import matplotlib.dates as md
import seaborn as sns
plt.style.use('seaborn-colorblind')
plt.figure(figsize=(8,6))
sns.swarmplot('toronto_time', 'description', data=df);
plt.show()
However the visualization is compressed on that day. I want to remove the day in the xlabel also stretch them according to hours (0:00 to 24:00)