Skip to content Skip to sidebar Skip to footer

Simple Tsplot For Timeseries

I have below dataframe: Date group count 0 2015-01-12 Category1 27 1 2015-01-19 Category1 2 2 2015-01-26 Category1 31 3 2015-02-02 Category1 20 4 201

Solution 1:

I guess tsplot is deprecated because people tend to think it would be useful for plotting timeseries - which isn't the case. Of course you may use it, see e.g. this question, but I would recommend simply plotting the data as a line plot:

ax = df.plot(x="Date", y="count")
ax.figure.autofmt_xdate()

enter image description here

Solution 2:

import seaborn as sns
sns.tsplot(data=pd.Series([10,15,20,15,20,25,20,25,30,35,30,35,40,45]), color="b")

enter image description here

However note that the answer of @ImportanceOfBeingErnest is more appropriate

Post a Comment for "Simple Tsplot For Timeseries"