polars_python/interop/numpy/
mod.rs

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