Complete the code to read an Excel file named 'data.xlsx' into a DataFrame.
import pandas as pd df = pd.[1]('data.xlsx')
The read_excel function from pandas reads Excel files into DataFrames.
Complete the code to read the Excel file 'data.xlsx' and load only the sheet named 'Sales'.
import pandas as pd df = pd.read_excel('data.xlsx', sheet_name=[1])
To read a specific sheet by name, set sheet_name to the sheet's name as a string.
Fix the error in the code to read an Excel file with pandas.
import pandas as pd df = pd.read_excel('data.xlsx', [1]='Sales')
The correct parameter name is sheet_name with an underscore.
Fill both blanks to read only columns 'A' and 'C' from the Excel sheet named 'Data'.
import pandas as pd df = pd.read_excel('file.xlsx', sheet_name=[1], usecols=[2])
Set sheet_name to 'Data' and usecols to the list of columns ['A', 'C'] to read only those columns.
Fill all three blanks to read the Excel file 'report.xlsx', load sheet 'Summary', and skip the first 2 rows.
import pandas as pd df = pd.read_excel([1], sheet_name=[2], skiprows=[3])
Pass the filename as a string, the sheet name as 'Summary', and set skiprows to 2 to skip the first two rows.