MCPcopy Create free account
hub / github.com/dask/dask / fix_index

Function fix_index

dask/dataframe/tests/test_multi.py:953–958  ·  view source on GitHub ↗
(out, dtype)

Source from the content-addressed store, hash-verified

951 pdf7r = pd.DataFrame({"c": [5, 6, 7, 8], "d": [5, 4, 3, 2]}, index=list("fghi"))
952
953 def fix_index(out, dtype):
954 # Workaround pandas bug where output dtype of empty index will be int64
955 # even if input was object.
956 if len(out) == 0:
957 return out.set_index(out.index.astype(dtype))
958 return out
959
960 for pdl, pdr in [
961 (pdf1l, pdf1r),

Callers 3

Calls 2

set_indexMethod · 0.80
astypeMethod · 0.45

Tested by

no test coverage detected