cudf.core.column.string.StringMethods.ip2int#

StringMethods.ip2int() Union[cudf.core.series.Series, cudf.core.index.GenericIndex]#

This converts ip strings to integers

Returns
Series/Index of str dtype

Examples

>>> import cudf
>>> s = cudf.Series(["12.168.1.1", "10.0.0.1"])
>>> s.str.ip2int()
0    212336897
1    167772161
dtype: int64

Returns 0’s if any string is not an IP.

>>> s = cudf.Series(["12.168.1.1", "10.0.0.1", "abc"])
>>> s.str.ip2int()
0    212336897
1    167772161
2            0
dtype: int64