Exporting superscript notation in pandas dataframe to csv or excel
问题 I would like to write the foll. to a csv file: df.loc[0] = ['Total (2000)', numpy.nan, numpy.nan, numpy.nan, 2.0, 1.6, '10^6 km^2'] Is there a way to do that while writing '10^6 km^2' in a format such that the 6 is a superscript to 10 and 2 is a superscript to km. If not possible in csv, can I export to excel? 回答1: One possible way is to change the actual contents of the dataframe before writing it to a csv (but you can automate this somewhat). As a proof of concept, using '\u2076' as the