working with time series snippets

PHOTO EMBED

Fri Apr 01 2022 16:34:12 GMT+0000 (Coordinated Universal Time)

Saved by @QuinnFox12 #nlp #pos #ngram

# https://www.dataquest.io/blog/tutorial-time-series-analysis-with-pandas/
df['TIME'] =  pd.to_datetime(df['Time'],unit='s')
df_time = df.set_index('TIME')
# Add columns with year, month, and Weekday Name
df_time['Year'] = df_time.index.year
df_time['Month'] = df_time.index.month
df_time['Weekday Name'] = df_time.index.weekday_name

# Display a random sampling of 5 rows
df_time.sample(5, random_state=0)

# Visualizing time series data
sns.set(rc={'figure.figsize':(11, 4)})
content_copyCOPY

https://stackoverflow.com/questions/19231871/convert-unix-time-to-readable-date-in-pandas-dataframe