support for pandas >= 2.0
This commit is contained in:
parent
c8476cebf6
commit
29a968b3a8
|
@ -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')
|
||||||
|
|
Loading…
Reference in New Issue