In [1]:
import numpy as np
import os
import pandas as pd
import warnings

import nelpy as nel

#warnings.filterwarnings("ignore")


/Users/ckemere/anaconda3/envs/pandas_19_2/lib/python3.6/site-packages/matplotlib-2.1.0-py3.6-macosx-10.7-x86_64.egg/matplotlib/cbook/deprecation.py:106: MatplotlibDeprecationWarning: The mpl_toolkits.axes_grid module was deprecated in version 2.1. Use mpl_toolkits.axes_grid1 and mpl_toolkits.axisartist provies the same functionality instead.

In [2]:
pd.__version__


Out[2]:
'0.19.2'

In [3]:
datadirs = ['/Users/ckemere/Development/Data/Buzsaki/']

fileroot = next( (dir for dir in datadirs if os.path.isdir(dir)), None)
# conda install pandas=0.19.2
if fileroot is None:
    raise FileNotFoundError('datadir not found')

load_from_nel = True

# load from nel file:
if load_from_nel:
    jar = nel.load_pkl(fileroot + 'gor01vvp01pin01_processed_speed.nel')
    exp_data = jar.exp_data
    aux_data = jar.aux_data
    del jar
    
    jar = nel.load_pkl(fileroot + 'gor01vvp01pin01_tables_speed.nel')
    df = jar.df
    df2 = jar.df2
    del jar

In [4]:
df = df.convert_objects(convert_numeric=True)
# df2 is already in maximally numeric form


/Users/ckemere/anaconda3/envs/pandas_19_2/lib/python3.6/site-packages/ipykernel/__main__.py:1: FutureWarning: convert_objects is deprecated.  Use the data-type specific converters pd.to_datetime, pd.to_timedelta and pd.to_numeric.

In [5]:
with pd.HDFStore('gor01vvp01pin01-metadata.h5') as store:
    store.put('Session_Metadata',df,format='fixed')
    store.append('Subset_Metadata',df2)


/Users/ckemere/anaconda3/envs/pandas_19_2/lib/python3.6/site-packages/IPython/core/interactiveshell.py:2802: PerformanceWarning: 
your performance may suffer as PyTables will pickle object types that it cannot
map directly to c-types [inferred_type->mixed,key->block3_values] [items->['animal', 'time', 'track', 'segments', 'segment_labels', 'Notes']]