[Python] How to import .xlsx in Jupyter Notebook from iPhone Carnets App?

Discussão em 'Python' iniciado por Stack, Março 9, 2025.

  1. Stack

    Stack Membro Participativo

    I would like to try to work the dataset in Jupyter Notebook from the iPhone Carnets App, but I can’t search the correct path. If someone can help me.

    The dataset I download from Kaggle. Are free files that I push into a folder. I try this code:

    import pandas as pd

    aguacates = pd.read_excel("⁨⁨⁨En mi iPhone⁩ ▸ ⁨video141_python_pildorasInfor⁩ ▸ Aguacate producción.xlsx")
    print(aguacates)


    And also this other:

    import pandas as pd

    aguacates = pd.read_excel("⁨⁨⁨En mi iPhone⁩ \\video141_python_pildorasInfor⁩\\Aguacate producción.xlsx")
    (aguacates)


    The error is:

    `FileNotFoundError Traceback (most recent call last)
    Cell In[2], line 3
    1 import pandas as pd
    ----> 3 aguacates = pd.read_excel("⁨⁨En mi iPhone⁩\\⁨video141_python_pildorasInfor⁩\\Aguacate producción.xlsx")
    4 print(aguacates)

    File /private/var/containers/Bundle/Application/D169301A-0DB7-4982-8FE3-9C6D0E0C17D8/Carnets.app/Library/lib/python3.11/site-packages/pandas/io/excel/_base.py:478, in read_excel(io, sheet_name, header, names, index_col, usecols, dtype, engine, converters, true_values, false_values, skiprows, nrows, na_values, keep_default_na, na_filter, verbose, parse_dates, date_parser, date_format, thousands, decimal, comment, skipfooter, storage_options, dtype_backend)
    476 if not isinstance(io, ExcelFile):
    477 should_close = True
    --> 478 io = ExcelFile(io, storage_options=storage_options, engine=engine)
    479 elif engine and engine != io.engine:
    480 raise ValueError(
    481 "Engine should not be specified when passing "
    482 "an ExcelFile - ExcelFile already has the engine set"
    483 )

    File /private/var/containers/Bundle/Application/D169301A-0DB7-4982-8FE3-9C6D0E0C17D8/Carnets.app/Library/lib/python3.11/site-packages/pandas/io/excel/_base.py:1496, in ExcelFile.__init__(self, path_or_buffer, engine, storage_options)
    1494 ext = "xls"
    1495 else:
    -> 1496 ext = inspect_excel_format(
    1497 content_or_path=path_or_buffer, storage_options=storage_options
    1498 )
    1499 if ext is None:
    1500 raise ValueError(
    1501 "Excel file format cannot be determined, you must specify "
    1502 "an engine manually."
    1503 )

    File /private/var/containers/Bundle/Application/D169301A-0DB7-4982-8FE3-9C6D0E0C17D8/Carnets.app/Library/lib/python3.11/site-packages/pandas/io/excel/_base.py:1371, in inspect_excel_format(content_or_path, storage_options)
    1368 if isinstance(content_or_path, bytes):
    1369 content_or_path = BytesIO(content_or_path)
    -> 1371 with get_handle(
    1372 content_or_path, "rb", storage_options=storage_options, is_text=False
    1373 ) as handle:
    1374 stream = handle.handle
    1375 stream.seek(0)

    File /private/var/containers/Bundle/Application/D169301A-0DB7-4982-8FE3-9C6D0E0C17D8/Carnets.app/Library/lib/python3.11/site-packages/pandas/io/common.py:868, in get_handle(path_or_buf, mode, encoding, compression, memory_map, is_text, errors, storage_options)
    859 handle = open(
    860 handle,
    861 ioargs.mode,
    (...)
    864 newline="",
    865 )
    866 else:
    867 # Binary mode
    --> 868 handle = open(handle, ioargs.mode)
    869 handles.append(handle)
    871 # Convert BytesIO or file objects passed with an encoding

    FileNotFoundError: [Errno 2] No such file or directory: '\u2068\u2068En mi iPhone\u2069\\\u2068video141_python_pildorasInfor\u2069\\Aguacate producción.xlsx'`

    Continue reading...

Compartilhe esta Página