Skip to main content

from_array_like_f32

Function from_array_like_f32 

Source
pub fn from_array_like_f32(obj: &Bound<'_, PyAny>) -> PyResult<Vec<f32>>
Expand description

Extract f32 values from any Python array-like object.

Attempts the following strategies in order:

  1. .values attribute (pandas Series / masked array).
  2. .__array__() method (NumPy array protocol).
  3. Direct iteration via __len__ + __getitem__.

ยงErrors

Returns a PyErr if none of the strategies succeeds or if an element cannot be converted to f32.