我正在尝试使用!cat
将数据帧写入csv文件,但我遇到了一些错误。
代码:
data.to_csv(r'C:\Users\Downloads\pydata\pydata-book-2nd-edition\examples\out.csv')
!cat C:\Users\Pruthvish\Downloads\pydata\pydata-book-2nd-edition\examples\out.csv
,something,a,b,c,d,message
0,one,1,2,3.0,4
1,two,5,6,,8,world
2,three,9,10,11.0,12,foo
错误:
'cat' is not recognized as an internal or external command, operable program or batch file.
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-194-9f4495d324cb> in <module>()
1 get_ipython().system('cat C:\\Users\\Downloads\\pydata\\pydata-book-2nd-edition\\examples\\out.csv')
----> 2 something(",a,b,c,d,message")
3 0,one,1,2,3.0,4
4 1,two,5,6,,8,world
5 2,three,9,10,11.0,12,foo
NameError: name 'something' is not defined
我甚至尝试了!type
和!more
,但名称错误仍然存在。我该如何解决这个错误?