I have a pandas
DataFrame containing leading zeros. I want to export it to CSV, but the to_csv()
method removes leading zeros from the numbers. How can I preserve them?
不确定您的代码究竟发生了什么,但最好替换 NaN,然后查看 0 在您的情况下是否表示 NaN。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.