Reputation: 336
How to draw plot with histograms of label distribution (its only 0 or 1) based on years
How to draw linear plot, where X coord is the date (year) and Y coord is the number of entries made in a given year
Thanks!
Upvotes: 0
Views: 125
Reputation: 287
if your dates are stored as datetime objects, then you can use the following :
import seaborn as sns
years=df['date'].dt.year
sns.distplot(years)
For the label, you can use :
label=1#0, you choose
df_lab=df.loc['label'==label]
years_label=df_lab['date'].dt.year
sns.distplot(years_label)
Upvotes: 1