Python Forum
problem with opening csv file in pandas
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem with opening csv file in pandas
Hello everyone,
See, I'm a Pycharm user and I'm currently learning how to use pandas for data analysis. But the problem is that I cannot open my csv file. Here is how it goes:

import pandas as pd
data = pd.read_csv('This PC\\Downloads\\sample.csv')
Traceback (most recent call last): File "C:/Users/91960/PycharmProjects/mmm/", line 2, in <module> data = pd.read_csv('This PC\\Downloads\\sample.csv','r') File "C:\Users\91960\PycharmProjects\mmm\venv\lib\site-packages\pandas\io\", line 676, in parser_f return _read(filepath_or_buffer, kwds) File "C:\Users\91960\PycharmProjects\mmm\venv\lib\site-packages\pandas\io\", line 448, in _read parser = TextFileReader(fp_or_buf, **kwds) File "C:\Users\91960\PycharmProjects\mmm\venv\lib\site-packages\pandas\io\", line 880, in __init__ self._make_engine(self.engine) File "C:\Users\91960\PycharmProjects\mmm\venv\lib\site-packages\pandas\io\", line 1114, in _make_engine self._engine = CParserWrapper(self.f, **self.options) File "C:\Users\91960\PycharmProjects\mmm\venv\lib\site-packages\pandas\io\", line 1891, in __init__ self._reader = parsers.TextReader(src, **kwds) File "pandas\_libs\parsers.pyx", line 374, in pandas._libs.parsers.TextReader.__cinit__ File "pandas\_libs\parsers.pyx", line 674, in pandas._libs.parsers.TextReader._setup_parser_source FileNotFoundError: [Errno 2] File This PC\Downloads\sample.csv does not exist: 'This PC\\Downloads\\sample.csv'
Please help!
the error message is pretty clear.
'This PC\\Downloads\\sample.csv' does not exist
looks like 'This PC' needs to be replaced with a real directory name
Thanks !

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to import an xml file to Pandas sjhazard 0 2,356 Jun-08-2021, 08:19 PM
Last Post: sjhazard
  Pandas and Date: problem with operator.How to resolve frame 6 4,335 May-13-2019, 05:50 PM
Last Post: frame
  Problem while showing a Pandas DataFrame Sirduke1 0 2,086 Aug-29-2018, 06:14 AM
Last Post: Sirduke1

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020