Class: Polars::BinaryNameSpace
- Inherits:
-
Object
- Object
- Polars::BinaryNameSpace
- Defined in:
- lib/polars/binary_name_space.rb
Overview
Series.bin namespace.
Instance Method Summary collapse
-
#contains(literal) ⇒ Series
Check if binaries in Series contain a binary substring.
-
#decode(encoding, strict: true) ⇒ Series
Decode a value using the provided encoding.
-
#encode(encoding) ⇒ Series
Encode a value using the provided encoding.
-
#ends_with(suffix) ⇒ Series
Check if string values end with a binary substring.
-
#get(index, null_on_oob: false) ⇒ Series
Get the byte value at the given index.
-
#head(n = 5) ⇒ Series
Take the first
nbytes of the binary values. -
#reinterpret(dtype:, endianness: "little") ⇒ Series
Interpret a buffer as a numerical polars type.
-
#size(unit = "b") ⇒ Series
Get the size of the binary values in a Series in the given unit.
-
#slice(offset, length = nil) ⇒ Series
Slice the binary values.
-
#starts_with(prefix) ⇒ Series
Check if values start with a binary substring.
-
#tail(n = 5) ⇒ Series
Take the last
nbytes of the binary values.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Polars::ExprDispatch
Instance Method Details
#contains(literal) ⇒ Series
Check if binaries in Series contain a binary substring.
31 32 33 |
# File 'lib/polars/binary_name_space.rb', line 31 def contains(literal) super end |
#decode(encoding, strict: true) ⇒ Series
Decode a value using the provided encoding.
124 125 126 |
# File 'lib/polars/binary_name_space.rb', line 124 def decode(encoding, strict: true) super end |
#encode(encoding) ⇒ Series
Encode a value using the provided encoding.
157 158 159 |
# File 'lib/polars/binary_name_space.rb', line 157 def encode(encoding) super end |
#ends_with(suffix) ⇒ Series
Check if string values end with a binary substring.
53 54 55 |
# File 'lib/polars/binary_name_space.rb', line 53 def ends_with(suffix) super end |
#get(index, null_on_oob: false) ⇒ Series
Get the byte value at the given index.
For example, index 0 would return the first byte of every binary value
and index -1 would return the last byte of every binary value.
The behavior if an index is out of bounds is determined by the argument
null_on_oob.
257 258 259 |
# File 'lib/polars/binary_name_space.rb', line 257 def get(index, null_on_oob: false) super end |
#head(n = 5) ⇒ Series
(1) A similar method exists for taking the last n bytes: tail.
(2) If n is negative, it is interpreted as "until the nth byte from the end",
e.g., head(-3) returns all but the last three bytes.
Take the first n bytes of the binary values.
284 285 286 |
# File 'lib/polars/binary_name_space.rb', line 284 def head(n = 5) super end |
#reinterpret(dtype:, endianness: "little") ⇒ Series
Interpret a buffer as a numerical polars type.
200 201 202 |
# File 'lib/polars/binary_name_space.rb', line 200 def reinterpret(dtype:, endianness: "little") super end |
#size(unit = "b") ⇒ Series
Get the size of the binary values in a Series in the given unit.
177 178 179 |
# File 'lib/polars/binary_name_space.rb', line 177 def size(unit = "b") super end |
#slice(offset, length = nil) ⇒ Series
Slice the binary values.
225 226 227 |
# File 'lib/polars/binary_name_space.rb', line 225 def slice(offset, length = nil) super end |
#starts_with(prefix) ⇒ Series
Check if values start with a binary substring.
75 76 77 |
# File 'lib/polars/binary_name_space.rb', line 75 def starts_with(prefix) super end |
#tail(n = 5) ⇒ Series
(1) A similar method exists for taking the first n bytes: head.
(2) If n is negative, it is interpreted as "starting at the nth byte",
e.g., tail(-3) returns all but the first three bytes.
Take the last n bytes of the binary values.
311 312 313 |
# File 'lib/polars/binary_name_space.rb', line 311 def tail(n = 5) super end |