Skip to content

Commit

Permalink
COMPAT: np.full not available in all versions, xref pandas-dev#16773
Browse files Browse the repository at this point in the history
  • Loading branch information
jreback committed Jul 17, 2017
1 parent 81f8ace commit 9bfd725
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pandas/core/sparse/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ def _init_dict(self, data, index, columns, dtype=None):

# TODO: figure out how to handle this case, all nan's?
# add in any other columns we want to have (completeness)
nan_arr = sp_maker(np.full(len(index), np.nan))
nan_arr = np.empty(len(index), dtype='float64')
nan_arr.fill(np.nan)
nan_arr = sp_maker(nan_arr)
sdict.update((c, nan_arr) for c in columns if c not in sdict)

return to_manager(sdict, columns, index)
Expand Down

0 comments on commit 9bfd725

Please sign in to comment.