本人windows系统中,使用read_csv,read_html,read_table等操作,路径中都可以以’\'符号隔开。
如:
frame = read_csv(E:\CS\Python\PythonforDataAnalysis\pydata-book-2nd-edition (1)\pydata-book-2nd-edition\examples\ex1.csv)
但是在to_csv,to_pickle等写入操作时,所有路径中的’\‘都需要改写成’/'才能正常接收
如:
pd.read_pickle('E:/CS/Python/PythonforDataAnalysis/pydata-book-2nd-edition (1)/pydata-book-2nd-edition/examples/frame_pickle')
本文探讨了在Windows系统中使用Python进行数据读写时,路径设置的差异性问题。指出在使用read_csv等读取操作时,路径中可以使用’',但在to_csv等写入操作时,需将所有路径中的’‘替换为’/'才能正常工作。
1653





