bug fix: iloc index missing on generate samples

This commit is contained in:
Steve Nyemba 2020-02-25 12:25:03 -06:00
parent 93176a2d09
commit 94780281d0
1 changed files with 1 additions and 1 deletions

View File

@ -616,7 +616,7 @@ class Predict(GNet):
else:
missing = []
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 = df[columns[0]].append(pd.Series(missing))