Pandas DF related problem - MISSING NUMBERS
''' In DS with Py, one of the end of module tasks, Given a list of numbers including some missing values, turn it into a pandas dataframe, impute the missing values with the mean, and finally return the dataframe. I have solved this challenge by not doing exactly the same as instructed and that's why even after solving the challenge, I am stuck here trying to find a way to do as said. ''' import numpy as np import pandas as pd lst = [float(x) if x != 'nan' else np.NaN for x in input().split()] df = pd.Series(lst) df = df.fillna(round(df.mean(),1)) print (df) Whenever I change that to df = pd.DataFrame(lst) Column name is automatically given as 0, which is expected but When I try to return that column like this Print (df.iloc[:,0] It prints everything fine but has one extra Name= 0 (for that column name) in the result and due to that, test doesn't pass. Can you suggest to get the expected output using pd.DataFrame??? Thanks in Advance!!!