File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments