Last active
September 3, 2018 20:20
-
-
Save bhishanpdl/4d69b4c62e8f0c91fb4c9dfd477b60b0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import pandas as pd | |
import calendar | |
# Ref: https://docs.python.org/2/library/datetime.html | |
df['release_year'] = pd.to_datetime(df['release_date'], format='%m/%d/%y') | |
df['release_month'] = df['release_year'].dt.month | |
df['month_name'] = df['release_month'].apply(lambda x: calendar.month_abbr[x]) | |
# 2018-02-28 21:03:37 | |
df[''] = pd.to_datetime(df[''], format='%Y-%m-%d %H:%M:%S') | |
df.dtypes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment