Python - use pandas in Jupyter

I’ve tried following Mosh’s instructions on his YouTube video YouTubeuQrJ0TkZlc&list=PLapSVm7bsRCdLq3_nFHZmVEtkLl2chkV&index=2&ab_channel=ProgrammingwithMosh @ 4H 18min 20 sec.
I’ve downloaded the vgsales.csv and created the HelloWorld.ipynb on my desktop as instructed. However, when I run the following code:

import pandas as pd
df = pd.read_csv(‘vgsales.csv’)
df

Instead of the data frame, I get the below. Please, can someone shed some light on this issue?

FileNotFoundError Traceback (most recent call last)
in
1 import pandas as pd
----> 2 df = pd.read_csv(‘vgsales.csv’)
3 df

~\anaconda3\lib\site-packages\pandas\io\parsers.py in read_csv(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, storage_options)
608 kwds.update(kwds_defaults)
609
→ 610 return _read(filepath_or_buffer, kwds)
611
612

~\anaconda3\lib\site-packages\pandas\io\parsers.py in _read(filepath_or_buffer, kwds)
460
461 # Create the parser.
→ 462 parser = TextFileReader(filepath_or_buffer, **kwds)
463
464 if chunksize or iterator:

~\anaconda3\lib\site-packages\pandas\io\parsers.py in init(self, f, engine, **kwds)
817 self.options[“has_index_names”] = kwds[“has_index_names”]
818
→ 819 self._engine = self._make_engine(self.engine)
820
821 def close(self):

~\anaconda3\lib\site-packages\pandas\io\parsers.py in _make_engine(self, engine)
1048 )
1049 # error: Too many arguments for “ParserBase”
→ 1050 return mapping[engine](self.f, **self.options) # type: ignore[call-arg]
1051
1052 def _failover_to_python(self):

~\anaconda3\lib\site-packages\pandas\io\parsers.py in init(self, src, **kwds)
1865
1866 # open handles
→ 1867 self._open_handles(src, kwds)
1868 assert self.handles is not None
1869 for key in (“storage_options”, “encoding”, “memory_map”, “compression”):

~\anaconda3\lib\site-packages\pandas\io\parsers.py in _open_handles(self, src, kwds)
1360 Let the readers open IOHanldes after they are done with their potential raises.
1361 “”"
→ 1362 self.handles = get_handle(
1363 src,
1364 “r”,

~\anaconda3\lib\site-packages\pandas\io\common.py in get_handle(path_or_buf, mode, encoding, compression, memory_map, is_text, errors, storage_options)
640 errors = “replace”
641 # Encoding
→ 642 handle = open(
643 handle,
644 ioargs.mode,

FileNotFoundError: [Errno 2] No such file or directory: ‘vgsales.csv’

I have the same problem. Did you manage to solve the issue?

When you open a file with the name “filename.ext”; you are telling the open() function that your file is in the current working directory . This is called a relative path.

file = open('filename.ext') //relative path

In the above code, you are not giving the full path to a file to the open() function, just its name - a relative path. The error “FileNotFoundError: [Errno 2] No such file or directory” is telling you that there is no file of that name in the working directory. So, try using the exact, or absolute path.

file = open(r'C:\path\to\your\filename.ext') //absolute path

In the above code, all of the information needed to locate the file is contained in the path string - absolute path.

If the user does not pass the full path to the file (on Unix type systems this means a path that starts with a slash), the python file path is interpreted relatively to the current working directory. The current working directory usually is the directory in which you started the program. In order to make this work, the directory containing the python executable must be in the PATH, a so-called environment variable that contains directories that are automatically used for searching executables when you enter a command. In any case, if your Python script file and your data input file are not in the same directory, you always have to specify either a relative path between them or you have to use an absolute path for one of them.