Merge branch 'support-pandas-2.0' into 'development'

support for pandas >= 2.0

See merge request damask/DAMASK!751
This commit is contained in:
Philip Eisenlohr 2023-04-14 12:07:29 +00:00
commit b827b26278
1 changed files with 4 additions and 1 deletions

View File

@ -603,4 +603,7 @@ class Table:
f = util.open_text(fname,'w')
f.write('\n'.join([f'# {c}' for c in self.comments] + [' '.join(labels)])+('\n' if labels else ''))
self.data.to_csv(f,sep=' ',na_rep='nan',index=False,header=False,line_terminator='\n')
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')