Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
348 B
2
Indexable
Never
import pandas as pd
import calendar

data = pd.read_csv("sales.csv")
print(data)
product_type = data['product_type'].value_counts()
print(product_type)
data['purchase_date']
data['month'] = pd.DatetimeIndex(data['purchase_date']).month
data.head()
month = data['month'].apply(lambda x: calendar.month_abbr[x]).value_counts()
print(month)