I thought I'd post how to save DataFrames to the ObjectStore and restore them since it took me a while to get it working (not obvious).

The only way that the round-trip seems to work with is to have the orientation set to "records":

# Save DataFrame data into object store
json_string = stock_history.to_json(orient='records')
qb.ObjectStore.Save("Last_Stock_History", json_string)

# Read back data from object store
json_string = qb.ObjectStore.ReadString("Last_Stock_History")
stock_history_new = pd.read_json(json_string, orient='records')

The main problem here is that the indexes are lost. You will need to reset_indexes and then recover them after:

# Flatten DataFrame (move all indexes into column data)
# Need to do this before converting to json_string
stock_history = my_dataframe.reset_index()


# Once you have loaded the data from the store you can restore the indexes
# Need to know what the original indexes were though
my_dataframe = stock_history.set_index(['symbol','time'])