Method: Polars::StringNameSpace#decode

Defined in:
lib/polars/string_name_space.rb

#decode(encoding, strict: true) ⇒ Series

Decode a value using the provided encoding.

Examples:

s = Polars::Series.new(["666f6f", "626172", nil])
s.str.decode("hex")
# =>
# shape: (3,)
# Series: '' [binary]
# [
#         b"foo"
#         b"bar"
#         null
# ]

Parameters:

  • The encoding to use.

  • (defaults to: true)

    How to handle invalid inputs:

    • true: An error will be thrown if unable to decode a value.
    • false: Unhandled values will be replaced with nil.

Returns:



434
435
436
# File 'lib/polars/string_name_space.rb', line 434

def decode(encoding, strict: true)
  super
end