Panda: read csv datetime
Revision as of 08:35, 7 August 2019 by Onnowpurbo (talk | contribs) (Created page with " import numpy as np import matplotlib.pyplot as plt import pandas as pd infile = '/home/onno/TensorFlow/TEMP-train.csv' mydateparser = lambda x: pd.datetime.strptime(x...")
import numpy as np import matplotlib.pyplot as plt import pandas as pd infile = '/home/onno/TensorFlow/TEMP-train.csv' mydateparser = lambda x: pd.datetime.strptime(x, "%Y-%m-%d %H:%M:%S") df = pd.read_csv(infile, sep=',', names=['datetime', 'value'], parse_dates=['datetime'], date_parser=mydateparser)