Which of the following expression returns the first two rows of df, defined below? import pandas as pd df = pd.DataFrame({'A':[34, 78, 54], 'B':[12, 67, 43]}, index=['r1', 'r2', 'r3'])
Which of the following expression returns the first two rows of df, defined below?
import pandas as pd df = pd.DataFrame({'A':[34, 78, 54], 'B':[12, 67, 43]}, index=['r1', 'r2', 'r3'])
a. df.iloc[:2]
b. Both df[:2] and df.iloc[:2]
c. df[:2]
d. None of the options