cudf.core.column.string.StringMethods.url_encode#

StringMethods.url_encode() SeriesOrIndex[source]#

Returns a URL-encoded format of each string. No format checking is performed. All characters are encoded except for ASCII letters, digits, and these characters: '.','_','-','~'. Encoding converts to hex using UTF-8 encoded bytes.

Returns:
Series or Index.

Examples

>>> import cudf
>>> s = cudf.Series(['A/B-C/D', 'e f.g', '4-5,6'])
>>> s.str.url_encode()
0    A%2FB-C%2FD
1        e%20f.g
2        4-5%2C6
dtype: object
>>> data = ["https://rapids.ai/start.html",
...     "https://medium.com/rapids-ai"]
>>> s = cudf.Series(data)
>>> s.str.url_encode()
0    https%3A%2F%2Frapids.ai%2Fstart.html
1    https%3A%2F%2Fmedium.com%2Frapids-ai
dtype: object