support for pandas >= 2.0

This commit is contained in:
Martin Diehl 2023-04-14 08:37:40 +02:00
parent c8476cebf6
commit 29a968b3a8
1 changed files with 4 additions and 1 deletions

View File

@ -603,4 +603,7 @@ class Table:
f = util.open_text(fname,'w') f = util.open_text(fname,'w')
f.write('\n'.join([f'# {c}' for c in self.comments] + [' '.join(labels)])+('\n' if labels else '')) f.write('\n'.join([f'# {c}' for c in self.comments] + [' '.join(labels)])+('\n' if labels else ''))
try: # backward compatibility
self.data.to_csv(f,sep=' ',na_rep='nan',index=False,header=False,lineterminator='\n')
except TypeError:
self.data.to_csv(f,sep=' ',na_rep='nan',index=False,header=False,line_terminator='\n') self.data.to_csv(f,sep=' ',na_rep='nan',index=False,header=False,line_terminator='\n')