[Python] Beginner - what is the difference between using a (.) to an underscore (_) on a read...

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

  1. Stack

    Stack Membro Participativo

    I have the below code

    import pandas as pd
    df = pd.read.excel("C:/Users/Monca/Documents/sample_data/inventory_data.xlsx")
    print(df.head())


    1- When the use of pd.read.excel after running the program with F5 I get an AttributeError.

    SAME CODE WITH ( _ )

    import pandas as pd
    df = pd.read_excel("C:/Users/Monca/Documents/sample_data/inventory_data.xlsx")
    print(df.head())


    1- When use pf pd.read_excel after running the program with F5 I get the desire output.

    Could someone explain what difference is making and probably provding an additional example.

    Thanks guys.

    Continue reading...

Compartilhe esta Página