import pandas as pd df = pd.read_pickle('./annot_all.pkl') df ld ls ls df? ls df tmp = 128.741918128.741918 129.261370129.261370 129.744981129.744981 130.216436130.216436 130.696288130.696288 131.158469131.158469 131.624660131.624660 132.093108132.093108 132.549775132.549775 133.014462133.014462 133.479401133.479401 141.949298141.949298 142.403835142.403835 142.752977142.752977 143.110767143.110767 143.435597143.435597 143.843640143.843640 144.325371144.325371 144.796450144.796450 145.261890145.261890 145.732468145.732468 146.203672146.203672 146.656830146.656830 147.138060147.138060 147.637336147.637336 148.181727148.181727 148.767224148.767224 149.389815149.389815 150.085593150.085593 150.849546150.849546 151.572393151.572393 152.313287152.313287 153.085260153.085260 153.708854153.708854 154.264273154.264273 154.793626154.793626 155.347041155.347041 155.946573155.946573 156.671426156.671426 165.124029165.124029 165.626313165.626313 166.159676166.159676 166.684016166.684016 167.180284167.180284 167.644471167.644471 168.107655168.107655 168.587882168.587882 169.093174169.093174 169.593452169.593452 170.089721170.089721 170.571953170.571953 171.038145171.038145 171.497318171.497318 171.968522171.968522 172.453763172.453763 172.946021172.946021 173.415220173.415220 173.848327173.848327 174.282436174.282436 174.703513174.703513 175.143637175.143637 175.613839175.613839 176.084041176.084041 176.570284176.570284 177.057529177.057529 177.545777177.545777 178.017984178.017984 178.486180178.486180 178.948362178.948362 179.401520179.401520 201.680461201.680461 202.094519202.094519 202.533642202.533642 202.956723202.956723 203.378802203.378802 203.754763203.754763 204.115685204.115685 204.481620204.481620 288.556502288.556502 289.054775289.054775 289.545028289.545028 290.048314290.048314 290.542578290.542578 291.041854291.041854 291.535114291.535114 292.028375292.028375 292.461482292.461482 292.880553292.880553 293.310652293.310652 293.763811293.763811 294.219475294.219475 294.713989294.713989 295.220534295.220534 295.709784295.709784 296.196027296.196027 296.679262296.679262 ls pwd ls df tmp = pd.read_csv("/nfs/NAS6/mahe/ceta-cnns/Train/20220803_120928UTC_V12.txt") tmp tmp.reindex() tmp.resetçindex() tmp.reset_index() tmp tmp[0] tmp = np.loadtxt("/nfs/NAS6/mahe/ceta-cnns/Train/20220803_120928UTC_V12.txt") import numpy as np tmp = np.loadtxt("/nfs/NAS6/mahe/ceta-cnns/Train/20220803_120928UTC_V12.txt") tmp tmp[0] tmp[0,0] tmp = tmp[:,0] tmp df df_tmp = pd.DataFrame(data=tmp) df_tmp df_tmp['annot'] = cachcach df_tmp['annot'] = 'cachcach' df_tmp['wavpath'] = '/nfs/NAS3/SABIOD/SITE/BOMBYX_MONACO_2022-07/wav/20220803_120928UTC_V12.wav' df_tmp df_tmp['time'] = df_tmp['0'] df_tmp['time'] = df_tmp.0 df_tmp df_tmp['0'] df_tmp.annot df_tmp df_tmp = pd.DataFrame(data={'time' : tmp}) df_tmp df_tmp['annot'] = 'cachcach' df_tmp['wavpath'] = '/nfs/NAS3/SABIOD/SITE/BOMBYX_MONACO_2022-07/wav/20220803_120928UTC_V12.wav' df_tmp df df_res = pd.concat([df, df_tmp]) df_res tmp = np.loadtxt("/nfs/NAS6/mahe/ceta-cnns/Train/20220803_110928UTC_V12.txt")[:,0] tmp df_tmp = pd.DataFrame(data={'time' : tmp}) df_tmp['annot'] = 'cachcach' df_tmp['wavpath'] = '/nfs/NAS3/SABIOD/SITE/BOMBYX_MONACO_2022-07/wav/20220803_110928UTC_V12.wav' df_tmp df_res = pd.concat([df_res, df_tmp]) df_res tmp = np.loadtxt("/nfs/NAS6/mahe/ceta-cnns/Train/20220729_120919UTC_V12.txt")[:,0] df_tmp = pd.DataFrame(data={'time' : tmp}) df_tmp['annot'] = 'cachcach' df_tmp df_tmp['wavpath'] = '/nfs/NAS3/SABIOD/SITE/BOMBYX_MONACO_2022-07/wav/20220729_120919UTC_V12.wav' df_tmp df_res = pd.concat([df_res, df_tmp]) df_res df_res = pd.to_pickle('./new_annot.pkl') df_res.to_pickle('./new_annot.pkl') ls pwd tmp = list(5.92267617, 11.84535234, 13.53166987, 15.50589526, 19.37208665, 24.92459556, 47.71044694, 49.64354264, 62.72278585, 94.18700302, 110.68001097, 113.64134905, 118.45352344, 130.75130244, 135.02879079, 144.11845352, 146.17493831, 163.32602139, 164.72443104, 181.05292021, 193.3918289 , 216.0542912 , 247.02495202, 249.24595558, 254.34603784, 273.5536057 , 296.38058678, 296.50397587, 299.0128873) tmp = [5.92267617, 11.84535234, 13.53166987, 15.50589526,] 19.37208665, 24.92459556, 47.71044694, 49.64354264, 62.72278585, 94.18700302, 110.68001097, 113.64134905, 118.45352344, 130.75130244, 135.02879079, 144.11845352, 146.17493831, 163.32602139, 164.72443104, 181.05292021, 193.3918289 , 216.0542912 , 247.02495202, 249.24595558, 254.34603784, 273.5536057 , 296.38058678, 296.50397587, tmp = [5.92267617, 11.84535234, 13.53166987, 15.50589526,] 19.37208665, 24.92459556, 47.71044694, 49.64354264, 62.72278585, 94.18700302, 110.68001097, 113.64134905, 118.45352344, 130.75130244, 135.02879079, 144.11845352, 146.17493831, 163.32602139, 164.72443104, 181.05292021, 193.3918289 , 216.0542912 , 247.02495202, 249.24595558, 254.34603784, 273.5536057 , 296.38058678, 296.50397587, 299.0128873 tmp = [5.92267617, 11.84535234, 13.53166987, 15.50589526,19.37208665, 24.92459556, 47.71044694, 49.64354264, 62.72278585, 94.18700302, 110.68001097, 113.64134905, 118.45352344, 130.75130244, 135.02879079, 144.11845352, 146.17493831, 163.32602139, 164.72443104, 181.05292021, 193.3918289 , 216.0542912 , 247.02495202, 249.24595558, 254.34603784, 273.5536057 , 296.38058678, 296.50397587, 299.0128873] tmp df_tmp = pd.DataFrame(data={'time' : tmp}) df_tmp['wavpath'] = '/nfs/NAS3/SABIOD/SITE/BOMBYX_MONACO_2022-07/wav/5.92267617, 11.84535234, 13.53166987, 15.50589526,.wav' 19.37208665, 24.92459556, 47.71044694, 49.64354264, 62.72278585, 94.18700302, 110.68001097, 113.64134905, 118.45352344, 130.75130244, 135.02879079, 144.11845352, 146.17493831, 163.32602139, 164.72443104, 181.05292021, 193.3918289 , 216.0542912 , 247.02495202, 249.24595558, 254.34603784, 273.5536057 , 296.38058678, 296.50397587, 299.0128873df_tmp df_tmp df_tmp = pd.DataFrame(data={'time' : tmp}) tmp df_tmp['wavpath'] = '/nfs/NAS3/SABIOD/SITE/BOMBYX_MONACO_2022-07/wav/20220809_010942UTC_V12.wav' df_tmp df_res df_tmp['annot'] = 'cachcach' df_tmp = pd.DataFrame(data={'time' : tmp}) df_tmp['annot'] = 'botbot' df_tmp['wavpath'] = '/nfs/NAS3/SABIOD/SITE/BOMBYX_MONACO_2022-07/wav/20220809_010942UTC_V12.wav' df_res = pd.concat([df_res, df_tmp]) df_res tmp = [10.65259117, 11.06388813, 15.01233891, 24.47216891, 41.58212229, 77.98190293, 96.2023581 , 103.64683301, 123.51247601, 131.53276666, 171.46970112, 189.69015629, 206.80010968, 236.53687963, 245.91445023, 263.80586784, 288.97724157, 293.04908144] df_tmp = pd.DataFrame(data={'time' : tmp}) df_tmp['annot'] = 'botbot' df_tmp['wavpath'] = '/nfs/NAS3/SABIOD/SITE/BOMBYX_MONACO_2022-07/wav/20220816_020950UTC_V12.wav' tmp = [23.03262956, 281.86180422] df_tmp df_res = pd.concat([df_res, df_tmp]) df_res tmp df_tmp = pd.DataFrame(data={'time' : tmp}) df_tmp['annot'] = 'botbot' df_tmp['wavpath'] = '/nfs/NAS3/SABIOD/SITE/BOMBYX_MONACO_2022-07/wav/20220728_060918UTC_V12.wav' df_res = pd.concat([df_res, df_tmp]) df_res tmp = [0.74033452, 1.76857691, 6.70414039, 9.87112695, 12.21551961, 19.33095695, 31.62873595, 51.78228681, 68.68659172, 70.33177954, 103.97587058, 108.12996984, 128.44803948, 150.78146422, 156.53962161, 178.2972306 , 194.13216342, 198.1217439 , 227.40608719, 259.28160132, 277.46092679] tmp df_tmp = pd.DataFrame(data={'time' : tmp}) df_tmp['annot'] = 'botbot' df_tmp['wavpath'] = '/nfs/NAS3/SABIOD/SITE/BOMBYX_MONACO_2022-07/wav/20220823_010952UTC_V12.wav' df_tmp df_res = pd.concat([df_res, df_tmp]) df_res.to_pickle('./new_annot.pkl') df_res df df_res df_copy = df_res.copy() df_copy df.wavpath.apply(np.replace('/BOMB', '/nfs/NAS5/SABIOD/SITE/BOMBYX/BOMB')) np.replace df.wavpath.apply(lambda x: x.replace('/BOMB', '/nfs/NAS5/SABIOD/SITE/BOMBYX/BOMB')) df_copy['wavpath2'] = df_copy.wavpath.apply(lambda x: x.replace('/BOMB', '/nfs/NAS5/SABIOD/SITE/BOMBYX/BOMB')) df_copy['wavpath2'] df_copy['wavpath2'] = df_res.wavpath.apply(lambda x: x.replace('/BOMBYX2', '/nfs/NAS5/SABIOD/SITE/BOMBYX/BOMBYX2')) df_copy['wavpath2'] df_copy df_copy['wavpath'] = df_res.wavpath.apply(lambda x: x.replace('/BOMBYX2', '/nfs/NAS5/SABIOD/SITE/BOMBYX/BOMBYX2')) df_copy df_res['wavpath'] = df_res.wavpath.apply(lambda x: x.replace('/BOMBYX2', '/nfs/NAS5/SABIOD/SITE/BOMBYX/BOMBYX2')) df_res df_res.to_pickle('./new_annot.pkl') df_res.reindex() df_res.reset_index() df_res = df_res.reset_index() df_res df_res.drop('index') df_res df.index df.drop(0) df df_res df_res.drop('index') df_res.drop(0) df_res = pd.read_pickle('new_annot.pkl') df_res df_res.reset_index() df_res.drop('index') df_res.index() df_res.index df_res.drop(index='index') df_res df_res = df_res.reset_index() df_res df_res.drop(index='index') df_res.index df_res df_res.drop(index='index') df_res df_res = pd.read_pickle('new_annot.pkl') df_res %history -f ./add_anotation.txt