def filter axis=:vector, &block
      dispatch_to_axis_pl axis, :filter, &block
    end
Retain vectors or rows if the block returns a truthy value.

== Description

For filtering out certain rows/vectors based on their values,
use the #filter method. By default it iterates over vectors and
keeps those vectors for which the block returns true. It accepts
an optional axis argument which lets you specify whether you want
to iterate over vectors or rows.

== Arguments

* +axis+ - The axis to map over. Can be :vector (or :column) or :row.
Default to :vector.

== Usage

# Filter vectors

df.filter do |vector|
vector.type == :numeric and vector.median < 50
end

# Filter rows

df.filter(:row) do |row|
row[:a] + row[:d] < 100
end