Skip to content

Commit f5c3e3e

Browse files
committed
prepare for future change in Pandas
1 parent 1df0243 commit f5c3e3e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

data_algebra/cdata.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,10 @@ def rowrecs_to_blocks(
333333
nvals = numpy.asarray(dtemp[dcol])
334334
if len(nvals) < 1:
335335
nvals = [None] * numpy.sum(want)
336-
res.loc[want, vk] = nvals
336+
if numpy.all(want):
337+
res[vk] = nvals # get around Pandas future warning
338+
else:
339+
res.loc[want, vk] = nvals
337340
# see about promoting composite columns to numeric
338341
for vk in set(value_keys):
339342
converted = local_data_model.to_numeric(res[vk], errors="coerce")
@@ -343,7 +346,7 @@ def rowrecs_to_blocks(
343346
res[vk] = converted
344347
if data.shape[0] < 1:
345348
# empty input produces emtpy output (with different column structure)
346-
res = res.iloc[range(0), :].reset_index(drop=True)
349+
res = res.iloc[range(0), :].reset_index(inplace=False, drop=True)
347350
if data.shape[0] <= 0:
348351
res = res.loc[range(0), :]
349352
res = res.reset_index(inplace=False, drop=True)

0 commit comments

Comments
 (0)