Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
data_cleaning_202001
df['timestamp_dt'] = pd.to_datetime(df['timestamp'], format='%Y-%m-%d')
df['year'] = df['timestamp_dt'].dt.year
df['month'] = df['timestamp_dt'].dt.month
df['weekday'] = df['timestamp_dt'].dt.weekday
print(df['year'].value_counts(dropna=False))
print()
print(df['month'].value_counts(dropna=False))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment