Error en el Lab 02.03 Tak3 (Fill in missing data= #229
soyudea
started this conversation in
02 - PYTHON
Replies: 1 comment
-
Perfecto! Ya se solucionó en clase, sin embargo, si quieres ver otra solución mira este post #226 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
El codigo me genera el dataframe pero dice que hay ambiguedad, no encuentro el problema
def fillna(df):
df = df.copy()
precio =d["price"]
media=precio.mean()
std = np.std(precio)
ind = df.index
malos= d['price'].isna().sum()
dat = np.random.normal(media, std, size=malos)
k=0
for i in range(len(d)):
if np.isnan(df.loc[ind[i],"price"])==True:
#j= np.random.randint(0, len(dat))
df.loc[ind[i],"price"] = round(dat[k],8)
k +=1
result = df
return result
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). (set session.debug=True for tracebacks)
Beta Was this translation helpful? Give feedback.
All reactions