Pandas timestamp to and from json
If I have correctly understood your problem, you are looking for a serialization way preserving the data types of a dataframe.
The problem is that the interchange formats internally use few types: only strings for csv, strings and numbers for json. Of course there are ways to give formatting hints at read time (date format for date columns in csv), and it is generaly easy to convert back to the proper type after extraction, by I think that you would hope a more natural way. As suggested by Attack68 you could use a database but for example a SQLite database would be off because it has no internal date type.
IMHO a simple way would be to rely on the good old pickle module. After all, a dataframe is a Python object that contains other Python objects, so pickle is good at serializing that. The only point to remember is that, at deserialization time, pandas will have to be imported before calling pickle.load.
But I have just tested with a (tiny) dataframe containing various datatypes, and pickle was great as correctly saving and restoring them.
Objects cannot be serialised to json so therefore need to be converted or parsed through a custom JsonEncoder class.
pandas Dataframe has a number of methods, like from_records to read json data. Yet when you read that json data back it is returned as int64 instead of timestamp.
There are many ways to skin a cat in pandas. What is the best way to preserve data structures when reading and writing json?