# # GET DATA dh3 = DataHandler() dh3.load_dataframe_from_csv( input_directory_path='/app/data/temp/4000181.7z/4000181/', filename='4000181-34566_2017-09-19_B_TEMP_SYNCHED_BT.csv', header=0, columns=[ 'timestamp', 'back_x', 'back_y', 'back_z', 'thigh_x', 'thigh_y', 'thigh_z', 'btemp', 'ttemp' ]) dh3.convert_column_from_str_to_datetime(column_name='timestamp') dh3.set_column_as_index("timestamp") dh3.add_new_column() dh3.add_labels_file_based_on_intervals( intervals={ '1': [['2017-09-19', '18:31:09', '23:59:59'], ['2017-09-20', '00:00:00', '08:23:08'], ['2017-09-20', '08:35:13', '16:03:58'], ['2017-09-20', '16:20:21', '23:59:59'], ['2017-09-21', '00:00:00', '09:23:07'], ['2017-09-21', '09:35:40', '23:59:59'], ['2017-09-22', '00:00:00', '09:54:29']], '3': [['2017-09-20', '08:23:09', '08:35:12'], ['2017-09-20', '16:03:59', '16:20:20'], ['2017-09-21', '09:23:08', '09:35:39']] }) dataframe_test = dh3.get_dataframe_iterator()
dh2.load_dataframe_from_csv( input_directory_path='/app/data/temp/testVegar.7z/testVegar/', filename='P1_vegar_B_TEMP_SYNCHED_BT.csv', header=0, columns=[ 'timestamp', 'back_x', 'back_y', 'back_z', 'thigh_x', 'thigh_y', 'thigh_z', 'btemp', 'ttemp' ]) dh2.convert_column_from_str_to_datetime(column_name='timestamp') dh2.set_column_as_index("timestamp") ################################################ ADD LABELS TO THE DATAFRAMES ########################## dh1.add_new_column() dh1.add_labels_file_based_on_intervals( intervals={ "1": [['2018-04-27', '10:03:37', '10:03:38'], ['2018-04-27', '10:03:39', '11:09:00']], '2': [['2018-04-27', '11:09:01', '12:19:00']], '3': [['2018-04-27', '12:19:01', '14:28:00']] }) dh2.add_new_column() dh2.add_labels_file_based_on_intervals( intervals={ "1": [['2018-04-24', '12:09:00', '13:08:00']], '2': [['2018-04-24', '13:08:01', '14:08:00']], '3': [['2018-04-24', '14:08:01', '15:08:00']] })
dh = DataHandler() sub_name = data_name.split(".")[0] input_dir = "../data/temp/xxx_x.7z/xxx_x/" filename = "xxx_xB_xxx_x_T_timesync_output_TEMP_BT.csv" dh.load_dataframe_from_csv( input_directory_path=input_dir, filename=filename, header=0, columns=['time', 'bx', 'by', 'bz', 'tx', 'ty', 'tz', 'btemp', 'ttemp']) dh.convert_column_from_str_to_datetime(column_name='time') dh.set_column_as_index("time") # # add labels dh.add_new_column("label") intervals = dh.read_labels_from_json( filepath="../data/temp/xxx_x.7z/xxx_x/xxx_x intervals.json") dh.add_labels_file_based_on_intervals(intervals=intervals) df = dh.get_dataframe_iterator() print(df.head(10)) print() print(df.dtypes) # # ######## # # # # DATA INPUT FORMAT SPECIFIC DONE # # # ####### # # # Do some magic numbering