4 ms·
Just tried this, but am getting an error with the datetime. How could I fix this? Traceback (most recent call last): File "hist.py", line 14, in <module>
by 7ewis 9y ago
Just tried this, but am getting an error with the datetime. How could I fix this?
Traceback (most recent call last):
File "hist.py", line 14, in <module>
data.datetime = pd.to_datetime(data.datetime)
File "/usr/local/lib/python2.7/site-packages/pandas/core/tools/datetimes.py", line 373, in to_datetime
values = _convert_listlike(arg._values, True, format)
File "/usr/local/lib/python2.7/site-packages/pandas/core/tools/datetimes.py", line 306, in _convert_listlike
raise e
pandas._libs.tslib.OutOfBoundsDatetime: Out of bounds
nanosecond timestamp: 1601-01-01 00:00:00
The time on my Mac is correct, and datetime gets the correct time?
- applecrazy 9y agoAah I got this strange issue too. Search for that 1601-01-01 time stamp in the exported text file and change it to something else that isn’t before the Unix epoch
- 7ewis 9y agoThat sorted it, cheers! How long is the Chrome database kept for? I use Chrome Canary and the standard Chrome, but only had a few hundred results in each, a lot less than I was expecting. I can't remember the last time I cleared my history either. Cool graph though anyway!
- applecrazy 9y agoI’m not sure how long the history is stored, but I had over 2k entries for six months of history. And, by the way, I’m not done with this series. Next week I’ll try to predict browsing patterns using this dataset.
- d0mine 9y agoe.g.: data.loc[data.datetime == '1601-01-01 00:00:00', 'datetime'] = '1970-01-01 00:00:00'
- xalava 9y agoYou can automate this by changing the query line to : sqlite3 data/ChromeHistory "SELECT datetime(last_visit_time/1000000-11644473600,'unixepoch','localtime'),url FROM urls WHERE last_visit_time > 0 ORDER BY last_visit_time desc" > data/hist.txt