Method: Polars::ArrayNameSpace#count_matches

Defined in:
lib/polars/array_name_space.rb

#count_matches(element) ⇒ Series

Count how often the value produced by element occurs.

Examples:

s = Polars::Series.new("a", [[1, 2, 3], [2, 2, 2]], dtype: Polars::Array.new(Polars::Int64, 3))
s.arr.count_matches(2)
# =>
# shape: (2,)
# Series: 'a' [u32]
# [
#         1
#         3
# ]

Parameters:

  • element (Object)

    An expression that produces a single value

Returns:



662
663
664
# File 'lib/polars/array_name_space.rb', line 662

def count_matches(element)
  super
end