Python - nimrody/knowledgebase GitHub Wiki
-
parse ISO timestamp
from dateutil import parser parser.parse('2019-05-19T12:10:25.825Z')
and use
.timestamp()
to get epoch seconds (float) -
Convert epoch to datetime and truncate to hours:
pd.to_datetime(b23_1041.ts, unit='s').dt.floor('h')
-
Top 25 pandas tricks and more from Data School
-
Setup commands to run on startup: Create a
.ipython/profile_default/startup/00-numpy.py
file and place commands inside. Such as:import numpy as np import matplotlib.pyplot as plt
-
Better defaults for matplotlib:
import seaborn as sns sns.set()