dtoolkit.geoaccessor.dataframe.H3.to_str#

H3.to_str() DataFrame[source]#

Converts 64-bit integer H3 cell index to hexadecimal string.

Returns:
DataFrame

With new H3 cell as the its index.

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_str()
88143541bdfffff    a
886528b2a3fffff    b
dtype: object
>>> df = pd.DataFrame(
...     {'label': ['a', 'b']},
...     index=[612845052823076863, 614269156845420543],
... )
>>> df
                   label
612845052823076863     a
614269156845420543     b
>>> df.h3.to_str()
                label
88143541bdfffff     a
886528b2a3fffff     b