0
A
回答
0
似乎很難直接在SPSS中完成。 一個可能的答案:使用python + pandas。
import pandas as pd
def add_leading_zero_to_csv(path_to_csv_file):
# open the file
df_csv = pd.read_csv(path_to_csv_file)
# you can possibly specify the format of a column if needed
df_csv['specific_column'] = df_csv['specific_column'].map(lambda x: '%.2f' % x)
# save the file (with a precision of 3 for all the floats)
df_csv.to_csv(path_to_csv_file, index=False, float_format='%.3g')
有關「g」格式的更多信息:Format Specification Mini-Language。
並注意浮點問題(例如,請參閱answer to this question)
相關問題
- 1. 將Excel數據導出爲.csv時,如何在列數據中添加引號?
- 2. 將前導零添加到數字
- 3. 如何在數字小於10時添加前導零?
- 4. JS或PHP將前導零添加到小數
- 5. 將數據導出爲CSV在CodeIgniter中
- 6. 如何爲小整數添加前導零速度模板?
- 7. 進口CSV添加數據導出
- 8. 小數點前無零點
- 9. 將前導零添加到MySQL數據中
- 10. 當我導出爲CSV時,如何將前導零保留在列中?
- 11. 將數據導出到csv
- 12. 在bash腳本添加前導零到浮點數
- 13. Excel VBA將數據導出爲CSV
- 14. 將數據導出爲csv附件
- 15. 將CGridView數據導出爲Csv - Yii Framework
- 16. 將數據庫導出爲CSV文件
- 17. 將SQLite數據導出爲CSV
- 18. PHP:將sql數據導出爲CSV
- 19. 將gridview數據導出爲CSV文件
- 20. 將sqlite數據庫導出爲csv - Sqlite.swift
- 21. 將數據導出爲CSV文件?
- 22. 將抓取的數據導出爲CSV
- 23. 將SQL Server數據導出爲CSV
- 24. 無零之前小數點
- 25. 在小數點前隱藏零點
- 26. 導出爲CSV時操作數據?
- 27. 將零加到數字的小數點之前
- 28. 在24小時內添加前導零的格式字符串
- 29. 將數據導出爲CSV時出現問題
- 30. 在添加前導零時用%h格式化整數