cudf.core.column.string.StringMethods.ip_to_int#

StringMethods.ip_to_int() SeriesOrIndex#

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