Informatics Practices

Write code statements for a dataframe df for the following :

(a) delete an existing column from it.

(b) delete rows from 3 to 6 from it.

(c) Check if the dataframe has any missing values.

(d) fill all missing values with 999 in it.

Python Pandas

5 Likes

Answer

(a)

>>> del df[<column_name>]

(b)

>>> df.drop(range(2, 6))

(c)

>>> df.isnull()

(d)

>>> df.fillna(999)

Answered By

3 Likes


Related Questions