Skip to content

Commit 98390d7

Browse files
jrebackalanbato
authored andcommitted
COMPAT: np.full not available in all versions, xref pandas-dev#16773 (pandas-dev#17000)
1 parent e5af131 commit 98390d7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/core/sparse/frame.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ def _init_dict(self, data, index, columns, dtype=None):
163163

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

169171
return to_manager(sdict, columns, index)

0 commit comments

Comments
 (0)