diff --git a/src/binding/python/openpmd_api/DaskDataFrame.py b/src/binding/python/openpmd_api/DaskDataFrame.py index 40a42f7b78..926879fd66 100644 --- a/src/binding/python/openpmd_api/DaskDataFrame.py +++ b/src/binding/python/openpmd_api/DaskDataFrame.py @@ -87,4 +87,11 @@ def particles_to_daskdataframe(particle_species): ] df = dd.from_delayed(dfs) + # set a header for the first column (row index) + # note: this is NOT the particle id + # TODO both these do not work: + # https://github.com/dask/dask/issues/10440 + # df.index.name = "row" + # df.index = df.index.rename("row") + return df diff --git a/src/binding/python/openpmd_api/DataFrame.py b/src/binding/python/openpmd_api/DataFrame.py index 710d6810e7..1248136a5a 100644 --- a/src/binding/python/openpmd_api/DataFrame.py +++ b/src/binding/python/openpmd_api/DataFrame.py @@ -67,4 +67,10 @@ def particles_to_dataframe(particle_species, slice=None): columns[column_name] = np.multiply( columns[column_name], rc.unit_SI) - return pd.DataFrame(columns) + df = pd.DataFrame(columns) + + # set a header for the first column (row index) + # note: this is NOT the particle id + df.index.name = "row" + + return df