From 0071e9b62dd794741fb34f5d89564b26252593bc Mon Sep 17 00:00:00 2001 From: shaunwbell Date: Wed, 22 May 2024 07:54:51 -0700 Subject: [PATCH] Update SOAP2ArchiveCSV.py - pandas error_on_badlines deprecation fix --- SOAP2ArchiveCSV.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SOAP2ArchiveCSV.py b/SOAP2ArchiveCSV.py index 246c05b..d9e3a6f 100755 --- a/SOAP2ArchiveCSV.py +++ b/SOAP2ArchiveCSV.py @@ -62,7 +62,7 @@ args = parser.parse_args() -df = pd.read_csv(args.infile,sep=';',index_col=False,dtype=object,error_bad_lines=False) +df = pd.read_csv(args.infile,sep=';',index_col=False,dtype=object,on_bad_lines='skip') if not args.archive_year: year = str(datetime.datetime.now().year) @@ -137,4 +137,4 @@ bd_thinned['hhmm'] = bd_thinned.apply(lambda row: str(pd.to_datetime(row['locationDate']).hour).zfill(2)+str(pd.to_datetime(row['locationDate']).minute).zfill(2), axis=1) out_columns=['platformId','latitude','longitude','year','doy','hhmm','value'] + ['locationClass'] bd_thinned[out_columns].dropna().to_csv(k + '.y' + year,' ',header=False,index=False,na_rep=np.nan,mode='a') - \ No newline at end of file +