bug fix: iloc index missing on generate samples

dev
Steve L. Nyemba 5 years ago
parent 93176a2d09
commit 94780281d0

@ -616,7 +616,7 @@ class Predict(GNet):
else: else:
missing = [] missing = []
i = np.where(ii == 0)[0] i = np.where(ii == 0)[0]
df = pd.DataFrame( df.iloc.apply(lambda row: self.values[np.random.choice(np.where(row != 0)[0],1)[0]] ,axis=1)) df = pd.DataFrame( df.iloc[i].apply(lambda row: self.values[np.random.choice(np.where(row != 0)[0],1)[0]] ,axis=1))
df.columns = columns df.columns = columns
df = df[columns[0]].append(pd.Series(missing)) df = df[columns[0]].append(pd.Series(missing))

Loading…
Cancel
Save