I'm following Lesson 1 (http://nbviewer.jupyter.org/urls/bitbucket.org/hrojas/learn-pandas/raw/master/lessons/01%20-%20Lesson.ipynb) on using Pandas with the Jupyter console from Anaconda.
I'm trying to export a DataFrame (dict) to a CSV file, here is my code, which matches the instruction in Lesson 1 :
df.to_csv('births1880.csv',index=False,header=False)
I'm pulling out my hair, bc I keep getting an error msg., and I don't know why. Here is the error message :
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'