dtoolkit.geoaccessor.dataframe.H3.is_valid#

property H3.is_valid: Series#

Validates H3 cell (hexagon or pentagon).

Returns:
Series(bool)

With H3 cell as the its index. Its values indicating whether the H3 cell is valid.

Examples

>>> import dtoolkit.geoaccessor
>>> import pandas as pd

String type H3 cell index.

>>> s = pd.Series(
...     ['a', 'b', 'c'],
...     index=['hello', 'world', '88143541bdfffff'],
... )
>>> s
hello              a
world              b
88143541bdfffff    c
dtype: object
>>> s.h3.is_valid
hello              False
world              False
88143541bdfffff     True
dtype: bool

Int type H3 cell index.

>>> s = pd.Series(
...     ['a', 'b', 'c', 'd'],
...     index=[
...         1,
...         10,
...         100000000000000000,
...         612845052823076863,
...     ],
... )
>>> s
1                     a
10                    b
100000000000000000    c
612845052823076863    d
dtype: object
>>> s.h3.is_valid
1                     False
10                    False
100000000000000000    False
612845052823076863     True
dtype: bool