Module 3 Quiz - Data Science
My problem is in the Quiz of module 3, from Data Science course. It could be said that I already have solved this problem, but at the end of my output there is something that I do not want, I mean, IDK how to quit that part; what I'm talking about is this: Name: 0, dtype: float64 I would like to have just the 'dtype', so what could I do, my code is the following if you want to check and tell me if something I put is causing this: import pandas as pd import numpy as np lst = [float(x) if x != 'nan' else 'NaN' for x in input().split()] new_lst = [] for j in lst: if j == 'NaN': continue else: new_lst.append(j) mean = np.mean(new_lst) for i in lst: if i == 'NaN': index = lst.index(i) lst.remove(i) lst.insert(index, mean.round(1)) else: continue lst = pd.DataFrame(lst) print(lst[0])