Commits

James Morrison committed 00bdbfa

using put command to HD5Store object

Comments (0)

Files changed (1)

hebtools/dwr/parse_raw.py

             if prob_file:
                 problem_files_arr.append(filepath)
             else:
-                files.append( raw_array )
+                files.append( raw_array 
         displacements_df = pd.concat(files)
-        displacements_df.to_hdf('buoy_data.h5','displacements', format='t',
-                                append=False, complib='blosc', complevel=9)
-        pd.DataFrame(problem_files_arr).to_hdf('buoy_data.h5', 'problem_files')
+        buoy_data = pd.HDFStore('buoy_data.h5', complib='blosc', complevel=9)
+        buoy_data.put('displacements', displacements_df, append=False,
+                      format='t')
+        buoy_data.put('problem_files', pd.Series(problem_files_arr),
+                      append=False, format='t')
         logging.info("finish iterate_over_files")
         return displacements_df