Skip to content

Commit 7b9a57f

Browse files
authored
COMPAT: np.full not available in all versions, xref #16773 (#17000)
1 parent 81f8ace commit 7b9a57f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pandas/core/sparse/frame.py

+3-1
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)