Skip to content

Commit

Permalink
Update SOAP2ArchiveCSV.py
Browse files Browse the repository at this point in the history
- pandas error_on_badlines deprecation fix
  • Loading branch information
shaunwbell authored May 22, 2024
1 parent 8086229 commit 0071e9b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SOAP2ArchiveCSV.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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')


0 comments on commit 0071e9b

Please sign in to comment.