How would I go about renaming the index on a dask dataframe? I tried it like so
df.index.name = 'foo'
but rechecking df.index.name shows it still being whatever it was previously.
This does not seem like an efficient way to do it, so I wouldn't be surprised if there is something more direct.
d.index.name starts off as 'foo';
def f(df, name):
df.index.name = name
return df
d.map_partitions(f, 'pow')
The output now has index name of 'pow'. If this is done with the threaded scheduler, I think you also change the index name of d
in-place (in which case you don't really need the output of map_partitions
).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With