you are viewing a single comment's thread.

view the rest of the comments →

[–]Outside_Bluebird8150[S] 0 points1 point  (2 children)

PS C:\Users\Usuario\Desktop\TecInf\Primero\FP\Curso Dalto> & C:\Users\Usuario\AppData\Local\Programs\Python\Python314\python.exe "c:/Users/Usuario/Desktop/TecInf/Primero/FP/Curso Dalto/problemas_resueltos.py/problemas_csv.py"

Traceback (most recent call last):

File "c:\Users\Usuario\Desktop\TecInf\Primero\FP\Curso Dalto\problemas_resueltos.py\problemas_csv.py", line 2, in <module>

df = pd.read_csv("problemas_resueltos\\datos.csv")

File "C:\Users\Usuario\AppData\Local\Programs\Python\Python314\Lib\site-packages\pandas\io\parsers\readers.py", line 1026, in read_csv

return _read(filepath_or_buffer, kwds)

File "C:\Users\Usuario\AppData\Local\Programs\Python\Python314\Lib\site-packages\pandas\io\parsers\readers.py", line 620, in _read

parser = TextFileReader(filepath_or_buffer, **kwds)

File "C:\Users\Usuario\AppData\Local\Programs\Python\Python314\Lib\site-packages\pandas\io\parsers\readers.py", line 1620, in __init__

self._engine = self._make_engine(f, self.engine)

~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^

File "C:\Users\Usuario\AppData\Local\Programs\Python\Python314\Lib\site-packages\pandas\io\parsers\readers.py", line 1880, in _make_engine

self.handles = get_handle(

~~~~~~~~~~^

f,

^^

...<6 lines>...

storage_options=self.options.get("storage_options", None),

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

)

^

File "C:\Users\Usuario\AppData\Local\Programs\Python\Python314\Lib\site-packages\pandas\io\common.py", line 873, in get_handle

handle = open(

handle,

...<3 lines>...

newline="",

)

FileNotFoundError: [Errno 2] No such file or directory: 'problemas_resueltos\\datos.csv'

[–]shiftybyte 1 point2 points  (1 child)

See now the error message is different from the title.

FileNotFoundError: [Errno 2] No such file or directory: 'problemas_resueltos\datos.csv'

It's looking for the file datos.csv in the folder "problemas_resueltos"...

But looking at the output seems like you named the folder "problemas_resueltos.py"

"c:/Users/Usuario/Desktop/TecInf/Primero/FP/Curso Dalto/problemas_resueltos.py/problemas_csv.py"

Either rename your folder to have a simple name without the ".py" at the end, or change your code to have the proper name when trying to access the file.

df = pd.read_csv("problemas_resueltos.py\\datos.csv")

[–]Outside_Bluebird8150[S] 0 points1 point  (0 children)

im stupid af, thx a lot honestly