Path: blob/main/crates/polars-python/src/interop/numpy/mod.rs
7892 views
macro_rules! with_match_physical_numpy_polars_type {(1$key_type:expr, | $_:tt $T:ident | $($body:tt)*2) => ({3macro_rules! __with_ty__ {( $_ $T:ident ) => ( $($body)* )}4use polars_core::datatypes::DataType as D;5match $key_type {6#[cfg(feature = "dtype-i8")]7D::Int8 => __with_ty__! { Int8Type },8#[cfg(feature = "dtype-i16")]9D::Int16 => __with_ty__! { Int16Type },10D::Int32 => __with_ty__! { Int32Type },11D::Int64 => __with_ty__! { Int64Type },12#[cfg(feature = "dtype-u8")]13D::UInt8 => __with_ty__! { UInt8Type },14#[cfg(feature = "dtype-u16")]15D::UInt16 => __with_ty__! { UInt16Type },16D::UInt32 => __with_ty__! { UInt32Type },17D::UInt64 => __with_ty__! { UInt64Type },18#[cfg(feature = "dtype-f16")]19D::Float16 => __with_ty__! { Float16Type },20D::Float32 => __with_ty__! { Float32Type },21D::Float64 => __with_ty__! { Float64Type },22dt => panic!("not implemented for dtype {:?}", dt),23}24})}2526pub mod to_numpy_df;27pub mod to_numpy_series;28mod utils;293031