Skip to content

Instantly share code, notes, and snippets.

@joonro
Last active July 11, 2019 23:36
Show Gist options
  • Select an option

  • Save joonro/c0c00f14113bbee4840d16bf1f70a72d to your computer and use it in GitHub Desktop.

Select an option

Save joonro/c0c00f14113bbee4840d16bf1f70a72d to your computer and use it in GitHub Desktop.
[pandas HDFStore] Storing and loading DataFrames via `pd.DataFrame`. #python #pandas
import pandas as pd
HDFStore = pd.HDFStore(os.path.join(home, 'Data/Name.ph5'), mode='r')
df = HDFStore['/df']
HDFStore.close()
import pandas as pd
HDFStore = pd.HDFStore(
os.path.join(home, 'Data/Name.ph5'),
mode='w',
complevel=9, complib='blosc'
)
HDFStore.put('df', df)
HDFStore.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment