Skip to content

Commit

Permalink
Cannot fillna for integer type
Browse files Browse the repository at this point in the history
  • Loading branch information
havakv committed Sep 2, 2024
1 parent 8e8370d commit a444bc7
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion pycox/models/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ def sample_alive_from_dates(dates, at_risk_dict, n_control=1):
lengths = np.array([at_risk_dict[x].shape[0] for x in dates]) # Can be moved outside
idx = (np.random.uniform(size=(n_control, dates.size)) * lengths).astype('int')
samp = np.empty((dates.size, n_control), dtype=int)
samp.fill(np.nan)

for it, time in enumerate(dates):
samp[it, :] = at_risk_dict[time][idx[:, it]]
Expand Down

0 comments on commit a444bc7

Please sign in to comment.