1) Which of the following method is used to delete row/column from a dataframe? a) delete() b) remove() c) discard() d) drop() 2) To delete a row from dataframe, which of the following method is correct? A dataframe is indexed with names. a) df.drop(df.row_index=’Jay’) b) df.drop(‘Jay’) c) df.drop(df.row=’Jay’) d) df.drop(df[‘Jay’]) 3) When you perform delete operation on dataframe, it returns a new dataframe always without changing the old dataframe. To avoid this which parameter you will use to change the original dataframe? a) intact = True b) inplace = True c) update = True d) replace = True 4) Ankita is working on dataframe wihch has 4 rows and 3 columns. She wrote df.drop(df.index[[1,3]]). Which rows will be deleted from the dataframe? a) Row 1 and Row 3 b) Rows between 1 and 3 c) Row 2 d) All rows from row no. 1 to index row no. 3 5) Which parameter is used to drop() method to delete columns? a) column = n (Where n is column number) b) col = n (Where n is column number) c) axis = 0 d) axis = 1 6) Can you delete multiple columns using del?  a) Yes b) No 7) pop() method does not display the contents of columns deleted a) True b) False 8) Does drop() delete column permanently from a dataframe. a) Yes b) No c) After using inplace parameter d) Both b and c 9) Which of the following can permanently delete a column from dataframe a) pop() b) Del command c) drop() d) Both a and b 10) Can we delete rows and columns together? a) Yes b) No

Quiz on deletion of rows and columns from a dataframe.

Leaderboard

Visual style

Options

Switch template

Continue editing: ?