0 votes
in Informatics Practices by (64.9k points)
Carefully observe the following code:

import pandas as pd

Year1={'Q1':5000,'Q2':8000,'Q3':12000,'Q4': 18000}

Year2={'A' :13000,'B':14000,'C':12000}

totSales={1:Year1,2:Year2}

df=pd.DataFrame(totSales)

print(df)

Answer the following:

i. List the index of the DataFrame df

ii. List the column names of DataFrame df

1 Answer

0 votes
by (305k points)
 
Best answer
i. The index labels of df will include Q1,Q2,Q3,Q4,A,B,C

ii. The column names of df will be: 1,2
...