CBSE Class 12 Informatics Practices
Question 72 of 167
Python Pandas — I — Question 37
Back to all questionsprint(Data.iloc[0 : 4, 1 : 4])
Reason — To display subset from dataframe using row and column numeric index/position, iloc is used with syntax <DF object>.iloc[<start row index>:<end row index>, <start col index>:<end col index>]. Therefore, according to this syntax, print(Data.iloc[0 : 4, 1 : 4]) is correct statement to display first four rows and second to fourth columns from a DataFrame Data.