You are required to impute missing values in a dataset containing the GDP value of many countries over many years. GDP typically increases year over year but some years have a missing value. What method would you apply to impute the missing value? Choose all the possible ways

df['gdp'].interpolate(method='linear', inplace=True) df['gdp'].fillna(method='bfill', inplace=True) df.head(10) df.tail(10) 'head' or 'tail' will give you the first 10 or last 10 records and hence is not at random. But 'sample' will provide 10 records at random. There is no function called 'random'

Exercise

results matching ""

    No results matching ""