Skip to content

Content Tagged "dataframe"

Page 1 of 1

Content Tagged "dataframe"

Convert Timestamp to DateTime for Pandas DataFrame

August 8, 2017Categories: Software, Tutorial
To convert a pandas data frame value from unix timestamp to python datetime you need to use: where: timestamp is the column containing the timestamp value unit='s' defines the unit of the timestamp (seconds in this case) You can actually replace the column altogether: Unfortunately, the…

Save Pandas DataFrame as Django Model

August 7, 2017Categories: Software, Tutorial
TL;DR: use bulk_upload coupled with a comprehension to speed up loading. Initially, I started to convert the data frame to a Model object row by row and save it. While easy, it's also arguably the slowest method to load records, because the save() call performs a commit . Then I looked up…

All tags