Created
January 21, 2020 19:39
-
-
Save liannewriting/a46cf1a120122c7b3b6db3edbf1fb67b to your computer and use it in GitHub Desktop.
data_cleaning_202001
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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