Complete the code to get the row labels of the DataFrame.
row_labels = df.[1]The index attribute gives the row labels of a DataFrame.
Complete the code to get the column labels of the DataFrame.
column_labels = df.[1]The columns attribute gives the column labels of a DataFrame.
Fix the error in the code to get the data values of the DataFrame.
data = df.[1]()The to_numpy() method returns the data values as a NumPy array. The values attribute is not a method, and get_values() is deprecated.
Fill both blanks to create a DataFrame with specified index and columns.
df = pd.DataFrame(data, index=[1], columns=[2])
The index parameter sets row labels, and columns sets column labels. Here, ['row1', 'row2'] are row labels and ['col1', 'col2'] are column labels.
Fill all three blanks to create a DataFrame from a dictionary with correct index and columns.
df = pd.DataFrame([1], index=[2], columns=[3])
The first blank is the data dictionary, the second is the row labels, and the third is the column labels matching the dictionary keys.