dtoolkit.geoaccessor.dataframe.H3.to_center_child#

H3.to_center_child(resolution: int = None) DataFrame[source]#

Get the center child of cell.

Parameters:
resolutionint, optional

The resolution for the children. If None, then use the current resolution of cell +1 .

Returns:
DataFrame

With new H3 center child cell.

Examples

>>> import dtoolkit.geoaccessor
>>> import pandas as pd
>>> s = pd.Series(['a', 'b'], index=[612845052823076863, 614269156845420543])
>>> s
612845052823076863    a
614269156845420543    b
dtype: object
>>> s.h3.to_center_child()
617348652448612351    a
618772756470956031    b
dtype: object
>>> df = pd.DataFrame(
...     {'label': ['a', 'b']},
...     index=[612845052823076863, 614269156845420543],
... )
>>> df
                   label
612845052823076863     a
614269156845420543     b
>>> df.h3.to_center_child()
                   label
617348652448612351     a
618772756470956031     b