Q. Consider the dataframe data given Below. Using the same dataframe data, answer the following:
Color Count Price
Apple Red 3 120
Apple Green 9 110
Pear Red 25 125
Pear Green 26 150
Lime Green 99 70
(a) Write statement to delete rows with labels 'Apple' and 'Lime'.
(b) Write statement to delete columns with labels 'Color' and 'Count'.
Answer :-
(a) data.drop (['Apple', 'Lime'])
(b) data.drop(['Color', 'Count'], axis = 1)
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )