Open mih opened 4 months ago
>>> import pandas as pd >>> df = pd.read_pickle('pickle/joe011_3.pickle') >>> type(df) >>> dict >>> from pprint import pprint >>> pprint({k: type(v) for k, v in df.items()}) {'column_names': <class 'list'>, 'event_names': <class 'numpy.ndarray'>, 'eventtimes': <class 'numpy.ndarray'>, 'gdf_file': <class 'str'>, 'spiketimes': <class 'numpy.ndarray'>}
This could be put into npz files: https://numpy.org/doc/stable/reference/generated/numpy.lib.format.html#module-numpy.lib.format
npz
>>> df = pd.read_pickle('pickle/joe011_3.pickle') >>> numpy.savez('dummy.npz', **df) >>> npz=numpy.load('dummy.npz') >>> npz['gdf_file'] array('joe011-345.gdf', dtype='<U14') >>> npz['gdf_file'].item() 'joe011-345.gdf'
but it can complicate the code in some cases.
This could be put into
npz
files: https://numpy.org/doc/stable/reference/generated/numpy.lib.format.html#module-numpy.lib.formatbut it can complicate the code in some cases.