Skip to content

Instantly share code, notes, and snippets.

#import needed package
import pandas as pd
#read file and create dataframe
df = pd.read_csv(r"file_path.csv", encoding= 'unicode_escape')
df.head() #view head of dataframe
#convert timestamp/datetime/etc column... from object (or other) datatype to datetime datatype if needed.
#longest process in this script if needed, otherwise ignore.
df['timestamp'] = df['timestamp'].apply(pd.Timestamp)