question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error While reading the CSV in Jupyter Notebook via Pandas

See original GitHub issue

HI Techies, I am new to python and pandas, i am trying to import a structured csv file in jupyter notebook by using conventional code .i.e

import pandas as pd
df=pd.read_csv("Datasets/Border_Crossing_Entry_Data")
df.head(5)

but every time i am getting the below error, please help me since i am supposed to submit my assignment

FileNotFoundError                         Traceback (most recent call last)
<ipython-input-11-33127abc1814> in <module>
      1 import pandas as pd
----> 2 df=pd.read_csv("Datasets/Border_Crossing_Entry_Data")
      3 df.head(5)

C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\parsers.py in parser_f(filepath_or_buffer, sep, delimiter, header, names, index_col, usecols, squeeze, prefix, mangle_dupe_cols, dtype, engine, converters, true_values, false_values, skipinitialspace, skiprows, skipfooter, nrows, na_values, keep_default_na, na_filter, verbose, skip_blank_lines, parse_dates, infer_datetime_format, keep_date_col, date_parser, dayfirst, cache_dates, iterator, chunksize, compression, thousands, decimal, lineterminator, quotechar, quoting, doublequote, escapechar, comment, encoding, dialect, error_bad_lines, warn_bad_lines, delim_whitespace, low_memory, memory_map, float_precision)
    683         )
    684 
--> 685         return _read(filepath_or_buffer, kwds)
    686 
    687     parser_f.__name__ = name

C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\parsers.py in _read(filepath_or_buffer, kwds)
    455 
    456     # Create the parser.
--> 457     parser = TextFileReader(fp_or_buf, **kwds)
    458 
    459     if chunksize or iterator:

C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\parsers.py in __init__(self, f, engine, **kwds)
    893             self.options["has_index_names"] = kwds["has_index_names"]
    894 
--> 895         self._make_engine(self.engine)
    896 
    897     def close(self):

C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\parsers.py in _make_engine(self, engine)
   1133     def _make_engine(self, engine="c"):
   1134         if engine == "c":
-> 1135             self._engine = CParserWrapper(self.f, **self.options)
   1136         else:
   1137             if engine == "python":

C:\ProgramData\Anaconda3\lib\site-packages\pandas\io\parsers.py in __init__(self, src, **kwds)
   1915         kwds["usecols"] = self.usecols
   1916 
-> 1917         self._reader = parsers.TextReader(src, **kwds)
   1918         self.unnamed_cols = self._reader.unnamed_cols
   1919 

pandas\_libs\parsers.pyx in pandas._libs.parsers.TextReader.__cinit__()

pandas\_libs\parsers.pyx in pandas._libs.parsers.TextReader._setup_parser_source()

FileNotFoundError: [Errno 2] File b'Datasets/Border_Crossing_Entry_Data' does not exist: b'Datasets/Border_Crossing_Entry_Data'`

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Shrinjoymaiticommented, Aug 31, 2021

Screenshot (43) I’m facing same issues. Help me please.

0reactions
Carreaucommented, Aug 31, 2021

Apologies, but this is a bug tracker, and as much as we do our best to help users, these are not Jupyter/IPython bugs.

Please use commands like ls, dir, pwd and make sure the file exists where you are trying to read from it. Also please read error message, you do not have the same errors.

Some are FileNotFound, some are NameError.

locking issue and marking recent comments os off-topic.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Parser Error when trying to read csv File with pandas on jupyter
The csv in question seems to be ; (semicolon) delimited. So, specify that as a parameter when calling read_csv
Read more >
Error-free import of CSV files using Pandas DataFrame
Therefore, I have laid out some steps to avoid any error while importing and loading a data file using pandas DataFrame. Reading and ......
Read more >
Why is Google Colab raising an error for reading in a csv and ...
Why am I seeing this error in while importing CSV file in Jupyter notebook? How to save your data you've already loaded and...
Read more >
I am getting an OS error and not sure why. - Kaggle
I am trying to read a CSV file using pandas read_csv function but I keep getting an OSerror. Here is the code. Please...
Read more >
Error while reading a csv file in pandas - tools
Whenever i compiled the code above i get the following result : SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found