Skip to content

Instantly share code, notes, and snippets.

@jjsantanna
Last active February 7, 2019 08:57
Show Gist options
  • Save jjsantanna/b308ec6555e9f2e65eaa467fae51d3c5 to your computer and use it in GitHub Desktop.
Save jjsantanna/b308ec6555e9f2e65eaa467fae51d3c5 to your computer and use it in GitHub Desktop.
Function for loading serveral .hdf5 files from a folder into a single dataframe
import glob #for reading recursively
import pandas as pd
def read_NL_dataset(output_dir):
all_files = glob.glob(output_dir+'/<FILE_NAMEish>*.hdf5')
df_all = pd.DataFrame()
print(all_files)
for all_file in all_files:
df_temp = pd.read_hdf(all_file, 'shodan')
df_all = df_all.append(df_temp)
return df_all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment