I have tried to read a csv dataset on python in jupyter notebooks using the pandas library but I come back with a message saying I do not have the right file or directory name.
`import pandas as pd
import matplotlib.pyplot as plt
import numpy as np`
`
path = ‘/Users/alfielenton/Documents/MonthlyGlobalTemp.csv’
df = pd.read_csv(‘/Users/alfielenton/Documents/MonthlyGlobalTemp.csv’)
`
And this is the error I am getting, what am I doing wrong?
`
FileNotFoundError Traceback (most recent call last)
<ipython-input-2-fe82d903835c> in <cell line: 2>()
1 path = '/Users/alfielenton/Documents/MonthlyGlobalTemp.csv'
----> 2 df = pd.read_csv('/Users/alfielenton/Documents/MonthlyGlobalTemp.csv')
4 frames
/usr/local/lib/python3.10/dist-packages/pandas/io/common.py in get_handle(path_or_buf, mode, encoding, compression, memory_map, is_text, errors, storage_options)
857 if ioargs.encoding and "b" not in ioargs.mode:
858 # Encoding
--> 859 handle = open(
860 handle,
861 ioargs.mode,
FileNotFoundError: [Errno 2] No such file or directory: '/Users/alfielenton/Documents/MonthlyGlobalTemp.csv'
`
Alfie Lenton is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.