1

Jupyter での Pandas の使用に関するレッスン 1 ( http://nbviewer.jupyter.org/urls/bitbucket.org/hrojas/learn-pandas/raw/master/lessons/01%20-%20Lesson.ipynb ) に従っています。アナコンダからコンソール。

DataFrame (dict) を CSV ファイルにエクスポートしようとしています。これが私のコードで、レッスン 1 の指示と一致します。

df.to_csv('births1880.csv',index=False,header=False)

髪を引っ張っていますが、エラー メッセージが表示され続けます。理由がわかりません。エラーメッセージは次のとおりです。

PermissionError                           Traceback (most recent call last)
<ipython-input-29-cb4a3386d140> in <module>()
----> 1 df.to_csv('births1880.csv',index=False,header=False)

/Applications/anaconda/lib/python3.5/site-packages/pandas/core/frame.py in to_csv(self, path_or_buf, sep, na_rep, float_format, columns, header, index, index_label, mode, encoding, compression, quoting, quotechar, line_terminator, chunksize, tupleize_cols, date_format, doublequote, escapechar, decimal, **kwds)
   1342                                      doublequote=doublequote,
   1343                                      escapechar=escapechar, decimal=decimal)
-> 1344         formatter.save()
   1345 
   1346         if path_or_buf is None:

/Applications/anaconda/lib/python3.5/site-packages/pandas/formats/format.py in save(self)
   1524             f = _get_handle(self.path_or_buf, self.mode,
   1525                             encoding=self.encoding,
-> 1526                             compression=self.compression)
   1527             close = True
   1528 

/Applications/anaconda/lib/python3.5/site-packages/pandas/io/common.py in _get_handle(path, mode, encoding, compression)
    422                 f = open(path, mode, encoding=encoding)
    423             else:
--> 424                 f = open(path, mode, errors='replace')
    425         else:
    426             f = open(path, mode)

PermissionError: [Errno 13] Permission denied: 'births1880.csv'
4

0 に答える 0