Trait polars::series::SeriesTrait [−][src]
pub trait SeriesTrait: Send + Sync + PrivateSeries + PrivateSeriesNumeric {}Show methods
fn rename(&mut self, name: &str); fn take_every(&self, n: usize) -> Series; fn sample_n(
&self,
n: usize,
with_replacement: bool
) -> Result<Series, PolarsError>; fn sample_frac(
&self,
frac: f64,
with_replacement: bool
) -> Result<Series, PolarsError>; fn cum_max(&self, _reverse: bool) -> Series { ... } fn cum_min(&self, _reverse: bool) -> Series { ... } fn cum_sum(&self, _reverse: bool) -> Series { ... } fn array_data(&self) -> Vec<&ArrayData, Global> { ... } fn chunk_lengths(
&self
) -> Map<Iter<'_, Arc<dyn Array + 'static>>, fn(&Arc<dyn Array + 'static>) -> usize> { ... } fn name(&self) -> &str { ... } fn field(&self) -> &Field { ... } fn dtype(&self) -> &DataType { ... } fn chunks(&self) -> &Vec<Arc<dyn Array + 'static>, Global> { ... } fn n_chunks(&self) -> usize { ... } fn shrink_to_fit(&mut self) { ... } fn i8(&self) -> Result<&ChunkedArray<Int8Type>, PolarsError> { ... } fn i16(&self) -> Result<&ChunkedArray<Int16Type>, PolarsError> { ... } fn i32(&self) -> Result<&ChunkedArray<Int32Type>, PolarsError> { ... } fn i64(&self) -> Result<&ChunkedArray<Int64Type>, PolarsError> { ... } fn f32(&self) -> Result<&ChunkedArray<Float32Type>, PolarsError> { ... } fn f64(&self) -> Result<&ChunkedArray<Float64Type>, PolarsError> { ... } fn u8(&self) -> Result<&ChunkedArray<UInt8Type>, PolarsError> { ... } fn u16(&self) -> Result<&ChunkedArray<UInt16Type>, PolarsError> { ... } fn u32(&self) -> Result<&ChunkedArray<UInt32Type>, PolarsError> { ... } fn u64(&self) -> Result<&ChunkedArray<UInt64Type>, PolarsError> { ... } fn bool(&self) -> Result<&ChunkedArray<BooleanType>, PolarsError> { ... } fn utf8(&self) -> Result<&ChunkedArray<Utf8Type>, PolarsError> { ... } fn date32(&self) -> Result<&ChunkedArray<Date32Type>, PolarsError> { ... } fn date64(&self) -> Result<&ChunkedArray<Date64Type>, PolarsError> { ... } fn time64_nanosecond(
&self
) -> Result<&ChunkedArray<Time64NanosecondType>, PolarsError> { ... } fn duration_nanosecond(
&self
) -> Result<&ChunkedArray<DurationNanosecondType>, PolarsError> { ... } fn duration_millisecond(
&self
) -> Result<&ChunkedArray<DurationMillisecondType>, PolarsError> { ... } fn list(&self) -> Result<&ChunkedArray<ListType>, PolarsError> { ... } fn categorical(&self) -> Result<&ChunkedArray<CategoricalType>, PolarsError> { ... } fn is_numeric_physical(&self) -> bool { ... } fn is_numeric(&self) -> bool { ... } fn append_array(
&mut self,
_other: Arc<dyn Array + 'static>
) -> Result<(), PolarsError> { ... } fn limit(&self, num_elements: usize) -> Series { ... } fn slice(&self, _offset: i64, _length: usize) -> Series { ... } fn append(&mut self, _other: &Series) -> Result<(), PolarsError> { ... } fn filter(
&self,
_filter: &ChunkedArray<BooleanType>
) -> Result<Series, PolarsError> { ... } fn take_iter(&self, _iter: &mut dyn Iterator<Item = usize>) -> Series { ... } unsafe fn take_iter_unchecked(
&self,
_iter: &mut dyn Iterator<Item = usize>
) -> Series { ... } unsafe fn take_unchecked(
&self,
_idx: &ChunkedArray<UInt32Type>
) -> Result<Series, PolarsError> { ... } unsafe fn take_opt_iter_unchecked(
&self,
_iter: &mut dyn Iterator<Item = Option<usize>>
) -> Series { ... } fn take_opt_iter(
&self,
_iter: &mut dyn Iterator<Item = Option<usize>>
) -> Series { ... } fn take(&self, _indices: &ChunkedArray<UInt32Type>) -> Series { ... } fn len(&self) -> usize { ... } fn is_empty(&self) -> bool { ... } fn rechunk(&self) -> Series { ... } fn head(&self, _length: Option<usize>) -> Series { ... } fn tail(&self, _length: Option<usize>) -> Series { ... } fn drop_nulls(&self) -> Series { ... } fn mean(&self) -> Option<f64> { ... } fn median(&self) -> Option<f64> { ... } fn expand_at_index(&self, _index: usize, _length: usize) -> Series { ... } fn cast_with_dtype(
&self,
_data_type: &DataType
) -> Result<Series, PolarsError> { ... } fn to_dummies(&self) -> Result<DataFrame, PolarsError> { ... } fn value_counts(&self) -> Result<DataFrame, PolarsError> { ... } fn get(&self, _index: usize) -> AnyValue<'_> { ... } unsafe fn get_unchecked(&self, _index: usize) -> AnyValue<'_> { ... } fn sort_in_place(&mut self, _reverse: bool) { ... } fn sort(&self, _reverse: bool) -> Series { ... } fn argsort(&self, _reverse: bool) -> ChunkedArray<UInt32Type> { ... } fn null_count(&self) -> usize { ... } fn unique(&self) -> Result<Series, PolarsError> { ... } fn n_unique(&self) -> Result<usize, PolarsError> { ... } fn arg_unique(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError> { ... } fn arg_min(&self) -> Option<usize> { ... } fn arg_max(&self) -> Option<usize> { ... } fn arg_true(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError> { ... } fn is_null(&self) -> ChunkedArray<BooleanType> { ... } fn is_not_null(&self) -> ChunkedArray<BooleanType> { ... } fn is_unique(&self) -> Result<ChunkedArray<BooleanType>, PolarsError> { ... } fn is_duplicated(&self) -> Result<ChunkedArray<BooleanType>, PolarsError> { ... } fn null_bits(&self) -> Vec<(usize, Option<&Buffer>), Global> { ... } fn reverse(&self) -> Series { ... } fn as_single_ptr(&mut self) -> Result<usize, PolarsError> { ... } fn shift(&self, _periods: i64) -> Series { ... } fn fill_none(
&self,
_strategy: FillNoneStrategy
) -> Result<Series, PolarsError> { ... } fn sum_as_series(&self) -> Series { ... } fn max_as_series(&self) -> Series { ... } fn min_as_series(&self) -> Series { ... } fn mean_as_series(&self) -> Series { ... } fn median_as_series(&self) -> Series { ... } fn var_as_series(&self) -> Series { ... } fn std_as_series(&self) -> Series { ... } fn quantile_as_series(&self, _quantile: f64) -> Result<Series, PolarsError> { ... } fn rolling_mean(
&self,
_window_size: u32,
_weight: Option<&[f64]>,
_ignore_null: bool,
_min_periods: u32
) -> Result<Series, PolarsError> { ... } fn rolling_sum(
&self,
_window_size: u32,
_weight: Option<&[f64]>,
_ignore_null: bool,
_min_periods: u32
) -> Result<Series, PolarsError> { ... } fn rolling_min(
&self,
_window_size: u32,
_weight: Option<&[f64]>,
_ignore_null: bool,
_min_periods: u32
) -> Result<Series, PolarsError> { ... } fn rolling_max(
&self,
_window_size: u32,
_weight: Option<&[f64]>,
_ignore_null: bool,
_min_periods: u32
) -> Result<Series, PolarsError> { ... } fn fmt_list(&self) -> String { ... } fn hour(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError> { ... } fn minute(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError> { ... } fn second(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError> { ... } fn nanosecond(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError> { ... } fn day(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError> { ... } fn weekday(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError> { ... } fn week(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError> { ... } fn ordinal_day(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError> { ... } fn month(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError> { ... } fn year(&self) -> Result<ChunkedArray<Int32Type>, PolarsError> { ... } fn strftime(&self, fmt: &str) -> Result<Series, PolarsError> { ... } fn timestamp(&self) -> Result<ChunkedArray<Int64Type>, PolarsError> { ... } fn clone_inner(&self) -> Arc<dyn SeriesTrait + 'static> { ... } fn get_as_any(&self, _index: usize) -> &(dyn Any + 'static) { ... } fn pow(&self, _exponent: f64) -> Result<Series, PolarsError> { ... } fn peak_max(&self) -> ChunkedArray<BooleanType> { ... } fn peak_min(&self) -> ChunkedArray<BooleanType> { ... } fn is_in(
&self,
_other: &Series
) -> Result<ChunkedArray<BooleanType>, PolarsError> { ... } fn checked_div(&self, _rhs: &Series) -> Result<Series, PolarsError> { ... }
Required methods
fn take_every(&self, n: usize) -> Series
fn take_every(&self, n: usize) -> Series
Take every nth value as a new Series
Sample n datapoints from this Series.
fn sample_frac(
&self,
frac: f64,
with_replacement: bool
) -> Result<Series, PolarsError>
fn sample_frac(
&self,
frac: f64,
with_replacement: bool
) -> Result<Series, PolarsError>
Sample a fraction between 0.0-1.0 of this ChunkedArray.
Provided methods
Get an array with the cumulative max computed at every element
Get an array with the cumulative min computed at every element
Get an array with the cumulative sum computed at every element
fn array_data(&self) -> Vec<&ArrayData, Global>
fn array_data(&self) -> Vec<&ArrayData, Global>
Get Arrow ArrayData
Get the lengths of the underlying chunks
fn shrink_to_fit(&mut self)
fn shrink_to_fit(&mut self)
Shrink the capacity of this array to fit it’s length.
fn i8(&self) -> Result<&ChunkedArray<Int8Type>, PolarsError>
fn i8(&self) -> Result<&ChunkedArray<Int8Type>, PolarsError>
Unpack to ChunkedArray of dtype i8
fn i16(&self) -> Result<&ChunkedArray<Int16Type>, PolarsError>
fn i16(&self) -> Result<&ChunkedArray<Int16Type>, PolarsError>
Unpack to ChunkedArray i16
fn i32(&self) -> Result<&ChunkedArray<Int32Type>, PolarsError>
fn i32(&self) -> Result<&ChunkedArray<Int32Type>, PolarsError>
Unpack to ChunkedArray
let s: Series = [1, 2, 3].iter().collect(); let s_squared: Series = s.i32() .unwrap() .into_iter() .map(|opt_v| { match opt_v { Some(v) => Some(v * v), None => None, // null value } }).collect();
fn i64(&self) -> Result<&ChunkedArray<Int64Type>, PolarsError>
fn i64(&self) -> Result<&ChunkedArray<Int64Type>, PolarsError>
Unpack to ChunkedArray of dtype i64
fn f32(&self) -> Result<&ChunkedArray<Float32Type>, PolarsError>
fn f32(&self) -> Result<&ChunkedArray<Float32Type>, PolarsError>
Unpack to ChunkedArray of dtype f32
fn f64(&self) -> Result<&ChunkedArray<Float64Type>, PolarsError>
fn f64(&self) -> Result<&ChunkedArray<Float64Type>, PolarsError>
Unpack to ChunkedArray of dtype f64
fn u8(&self) -> Result<&ChunkedArray<UInt8Type>, PolarsError>
fn u8(&self) -> Result<&ChunkedArray<UInt8Type>, PolarsError>
Unpack to ChunkedArray of dtype u8
fn u16(&self) -> Result<&ChunkedArray<UInt16Type>, PolarsError>
fn u16(&self) -> Result<&ChunkedArray<UInt16Type>, PolarsError>
Unpack to ChunkedArray of dtype u16
fn u32(&self) -> Result<&ChunkedArray<UInt32Type>, PolarsError>
fn u32(&self) -> Result<&ChunkedArray<UInt32Type>, PolarsError>
Unpack to ChunkedArray of dtype u32
fn u64(&self) -> Result<&ChunkedArray<UInt64Type>, PolarsError>
fn u64(&self) -> Result<&ChunkedArray<UInt64Type>, PolarsError>
Unpack to ChunkedArray of dtype u64
fn bool(&self) -> Result<&ChunkedArray<BooleanType>, PolarsError>
fn bool(&self) -> Result<&ChunkedArray<BooleanType>, PolarsError>
Unpack to ChunkedArray of dtype bool
fn utf8(&self) -> Result<&ChunkedArray<Utf8Type>, PolarsError>
fn utf8(&self) -> Result<&ChunkedArray<Utf8Type>, PolarsError>
Unpack to ChunkedArray of dtype utf8
fn date32(&self) -> Result<&ChunkedArray<Date32Type>, PolarsError>
fn date32(&self) -> Result<&ChunkedArray<Date32Type>, PolarsError>
Unpack to ChunkedArray of dtype date32
fn date64(&self) -> Result<&ChunkedArray<Date64Type>, PolarsError>
fn date64(&self) -> Result<&ChunkedArray<Date64Type>, PolarsError>
Unpack to ChunkedArray of dtype date64
fn time64_nanosecond(
&self
) -> Result<&ChunkedArray<Time64NanosecondType>, PolarsError>
fn time64_nanosecond(
&self
) -> Result<&ChunkedArray<Time64NanosecondType>, PolarsError>
Unpack to ChunkedArray of dtype time64_nanosecond
fn duration_nanosecond(
&self
) -> Result<&ChunkedArray<DurationNanosecondType>, PolarsError>
fn duration_nanosecond(
&self
) -> Result<&ChunkedArray<DurationNanosecondType>, PolarsError>
Unpack to ChunkedArray of dtype duration_nanosecond
fn duration_millisecond(
&self
) -> Result<&ChunkedArray<DurationMillisecondType>, PolarsError>
fn duration_millisecond(
&self
) -> Result<&ChunkedArray<DurationMillisecondType>, PolarsError>
Unpack to ChunkedArray of dtype duration_millisecond
fn list(&self) -> Result<&ChunkedArray<ListType>, PolarsError>
fn list(&self) -> Result<&ChunkedArray<ListType>, PolarsError>
Unpack to ChunkedArray of dtype list
fn categorical(&self) -> Result<&ChunkedArray<CategoricalType>, PolarsError>
fn categorical(&self) -> Result<&ChunkedArray<CategoricalType>, PolarsError>
Unpack to ChunkedArray of dtype categorical
fn is_numeric_physical(&self) -> bool
fn is_numeric_physical(&self) -> bool
Check if underlying physical data is numeric.
Date types and Categoricals are also considered numeric.
fn is_numeric(&self) -> bool
fn is_numeric(&self) -> bool
Check if underlying data is numeric
fn append_array(
&mut self,
_other: Arc<dyn Array + 'static>
) -> Result<(), PolarsError>
fn append_array(
&mut self,
_other: Arc<dyn Array + 'static>
) -> Result<(), PolarsError>
Append Arrow array of same dtype to this Series.
Take num_elements
from the top as a zero copy view.
Get a zero copy view of the data.
When offset is negative the offset is counted from the end of the array
Append a Series of the same type in place.
fn filter(
&self,
_filter: &ChunkedArray<BooleanType>
) -> Result<Series, PolarsError>
fn filter(
&self,
_filter: &ChunkedArray<BooleanType>
) -> Result<Series, PolarsError>
Filter by boolean mask. This operation clones data.
Take by index from an iterator. This operation clones the data.
Safety
Out of bounds access doesn’t Error but will return a Null value
unsafe fn take_iter_unchecked(
&self,
_iter: &mut dyn Iterator<Item = usize>
) -> Series
unsafe fn take_iter_unchecked(
&self,
_iter: &mut dyn Iterator<Item = usize>
) -> Series
Take by index from an iterator. This operation clones the data.
Safety
This doesn’t check any bounds or null validity.
unsafe fn take_unchecked(
&self,
_idx: &ChunkedArray<UInt32Type>
) -> Result<Series, PolarsError>
unsafe fn take_unchecked(
&self,
_idx: &ChunkedArray<UInt32Type>
) -> Result<Series, PolarsError>
Take by index if ChunkedArray contains a single chunk.
Safety
This doesn’t check any bounds. Null validity is checked.
Take by index from an iterator. This operation clones the data.
Safety
This doesn’t check any bounds or null validity.
Take by index from an iterator. This operation clones the data.
Safety
Out of bounds access doesn’t Error but will return a Null value
fn take(&self, _indices: &ChunkedArray<UInt32Type>) -> Series
fn take(&self, _indices: &ChunkedArray<UInt32Type>) -> Series
Take by index. This operation is clone.
Safety
Out of bounds access doesn’t Error but will return a Null value
fn drop_nulls(&self) -> Series
fn drop_nulls(&self) -> Series
Drop all null values and return a new Series.
Returns the mean value in the array Returns an option because the array is nullable.
Returns the median value in the array Returns an option because the array is nullable.
fn expand_at_index(&self, _index: usize, _length: usize) -> Series
fn expand_at_index(&self, _index: usize, _length: usize) -> Series
Create a new Series filled with values at that index.
Example
use polars_core::prelude::*; let s = Series::new("a", [0i32, 1, 8]); let expanded = s.expand_at_index(2, 4); assert_eq!(Vec::from(expanded.i32().unwrap()), &[Some(8), Some(8), Some(8), Some(8)])
fn cast_with_dtype(&self, _data_type: &DataType) -> Result<Series, PolarsError>
fn to_dummies(&self) -> Result<DataFrame, PolarsError>
fn to_dummies(&self) -> Result<DataFrame, PolarsError>
Create dummy variables. See DataFrame
fn value_counts(&self) -> Result<DataFrame, PolarsError>
Get a single value by index. Don’t use this operation for loops as a runtime cast is needed for every iteration.
unsafe fn get_unchecked(&self, _index: usize) -> AnyValue<'_>
unsafe fn get_unchecked(&self, _index: usize) -> AnyValue<'_>
Get a single value by index. Don’t use this operation for loops as a runtime cast is needed for every iteration.
Safety
Does not do any bounds checking
fn sort_in_place(&mut self, _reverse: bool)
fn sort_in_place(&mut self, _reverse: bool)
Sort in place.
fn argsort(&self, _reverse: bool) -> ChunkedArray<UInt32Type>
fn argsort(&self, _reverse: bool) -> ChunkedArray<UInt32Type>
Retrieve the indexes needed for a sort.
fn null_count(&self) -> usize
fn null_count(&self) -> usize
Count the null values.
fn unique(&self) -> Result<Series, PolarsError>
fn unique(&self) -> Result<Series, PolarsError>
Get unique values in the Series.
fn n_unique(&self) -> Result<usize, PolarsError>
fn n_unique(&self) -> Result<usize, PolarsError>
Get unique values in the Series.
fn arg_unique(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
fn arg_unique(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
Get first indexes of unique values.
fn arg_true(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
fn arg_true(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
Get indexes that evaluate true
fn is_null(&self) -> ChunkedArray<BooleanType>
fn is_null(&self) -> ChunkedArray<BooleanType>
Get a mask of the null values.
fn is_not_null(&self) -> ChunkedArray<BooleanType>
fn is_not_null(&self) -> ChunkedArray<BooleanType>
Get a mask of the non-null values.
fn is_unique(&self) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn is_unique(&self) -> Result<ChunkedArray<BooleanType>, PolarsError>
Get a mask of all the unique values.
fn is_duplicated(&self) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn is_duplicated(&self) -> Result<ChunkedArray<BooleanType>, PolarsError>
Get a mask of all the duplicated values.
Get the bits that represent the null values of the underlying ChunkedArray
fn as_single_ptr(&mut self) -> Result<usize, PolarsError>
fn as_single_ptr(&mut self) -> Result<usize, PolarsError>
Rechunk and return a pointer to the start of the Series. Only implemented for numeric types
Shift the values by a given period and fill the parts that will be empty due to this operation
with Nones
.
NOTE: If you want to fill the Nones with a value use the
shift
operation on ChunkedArray<T>
.
Example
fn example() -> Result<()> { let s = Series::new("series", &[1, 2, 3]); let shifted = s.shift(1); assert_eq!(Vec::from(shifted.i32()?), &[None, Some(1), Some(2)]); let shifted = s.shift(-1); assert_eq!(Vec::from(shifted.i32()?), &[Some(2), Some(3), None]); let shifted = s.shift(2); assert_eq!(Vec::from(shifted.i32()?), &[None, None, Some(1)]); Ok(()) } example();
fn fill_none(&self, _strategy: FillNoneStrategy) -> Result<Series, PolarsError>
fn fill_none(&self, _strategy: FillNoneStrategy) -> Result<Series, PolarsError>
Replace None values with one of the following strategies:
- Forward fill (replace None with the previous value)
- Backward fill (replace None with the next value)
- Mean fill (replace None with the mean of the whole array)
- Min fill (replace None with the minimum of the whole array)
- Max fill (replace None with the maximum of the whole array)
NOTE: If you want to fill the Nones with a value use the
fill_none
operation on ChunkedArray<T>
.
Example
fn example() -> Result<()> { let s = Series::new("some_missing", &[Some(1), None, Some(2)]); let filled = s.fill_none(FillNoneStrategy::Forward)?; assert_eq!(Vec::from(filled.i32()?), &[Some(1), Some(1), Some(2)]); let filled = s.fill_none(FillNoneStrategy::Backward)?; assert_eq!(Vec::from(filled.i32()?), &[Some(1), Some(2), Some(2)]); let filled = s.fill_none(FillNoneStrategy::Min)?; assert_eq!(Vec::from(filled.i32()?), &[Some(1), Some(1), Some(2)]); let filled = s.fill_none(FillNoneStrategy::Max)?; assert_eq!(Vec::from(filled.i32()?), &[Some(1), Some(2), Some(2)]); let filled = s.fill_none(FillNoneStrategy::Mean)?; assert_eq!(Vec::from(filled.i32()?), &[Some(1), Some(1), Some(2)]); Ok(()) } example();
fn sum_as_series(&self) -> Series
fn sum_as_series(&self) -> Series
Get the sum of the Series as a new Series of length 1.
fn max_as_series(&self) -> Series
fn max_as_series(&self) -> Series
Get the max of the Series as a new Series of length 1.
fn min_as_series(&self) -> Series
fn min_as_series(&self) -> Series
Get the min of the Series as a new Series of length 1.
fn mean_as_series(&self) -> Series
fn mean_as_series(&self) -> Series
Get the mean of the Series as a new Series of length 1.
fn median_as_series(&self) -> Series
fn median_as_series(&self) -> Series
Get the median of the Series as a new Series of length 1.
fn var_as_series(&self) -> Series
fn var_as_series(&self) -> Series
Get the variance of the Series as a new Series of length 1.
fn std_as_series(&self) -> Series
fn std_as_series(&self) -> Series
Get the standard deviation of the Series as a new Series of length 1.
fn quantile_as_series(&self, _quantile: f64) -> Result<Series, PolarsError>
fn quantile_as_series(&self, _quantile: f64) -> Result<Series, PolarsError>
Get the quantile of the ChunkedArray as a new Series of length 1.
Apply a rolling mean to a Series. See: ChunkedArray::rolling_mean.
Apply a rolling sum to a Series. See: ChunkedArray::rolling_mean.
Apply a rolling min to a Series. See: ChunkedArray::rolling_mean.
Apply a rolling max to a Series. See: ChunkedArray::rolling_mean.
fn hour(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
fn hour(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
Extract hour from underlying NaiveDateTime representation. Returns the hour number from 0 to 23.
fn minute(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
fn minute(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
Extract minute from underlying NaiveDateTime representation. Returns the minute number from 0 to 59.
fn second(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
fn second(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
Extract second from underlying NaiveDateTime representation. Returns the second number from 0 to 59.
fn nanosecond(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
fn nanosecond(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
Returns the number of nanoseconds since the whole non-leap second. The range from 1,000,000,000 to 1,999,999,999 represents the leap second.
fn day(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
fn day(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
Extract day from underlying NaiveDateTime representation. Returns the day of month starting from 1.
The return value ranges from 1 to 31. (The last day of month differs by months.)
fn weekday(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
fn weekday(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
Returns the weekday number where monday = 0 and sunday = 6
fn week(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
fn week(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
Returns the ISO week number starting from 1. The return value ranges from 1 to 53. (The last week of year differs by years.)
fn ordinal_day(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
fn ordinal_day(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
Returns the day of year starting from 1.
The return value ranges from 1 to 366. (The last day of year differs by years.)
fn month(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
fn month(&self) -> Result<ChunkedArray<UInt32Type>, PolarsError>
Extract month from underlying NaiveDateTime representation. Returns the month number starting from 1.
The return value ranges from 1 to 12.
fn year(&self) -> Result<ChunkedArray<Int32Type>, PolarsError>
fn year(&self) -> Result<ChunkedArray<Int32Type>, PolarsError>
Extract month from underlying NaiveDateTime representation. Returns the year number in the calendar date.
Format Date32/Date64 with a fmt
rule. See chrono strftime/strptime.
fn timestamp(&self) -> Result<ChunkedArray<Int64Type>, PolarsError>
fn timestamp(&self) -> Result<ChunkedArray<Int64Type>, PolarsError>
Convert date(time) object to timestamp in ms.
fn clone_inner(&self) -> Arc<dyn SeriesTrait + 'static>
fn clone_inner(&self) -> Arc<dyn SeriesTrait + 'static>
Clone inner ChunkedArray and wrap in a new Arc
fn get_as_any(&self, _index: usize) -> &(dyn Any + 'static)
fn get_as_any(&self, _index: usize) -> &(dyn Any + 'static)
Get the value at this index as a downcastable Any trait ref.
Raise a numeric series to the power of exponent.
fn peak_max(&self) -> ChunkedArray<BooleanType>
fn peak_max(&self) -> ChunkedArray<BooleanType>
Get a boolean mask of the local maximum peaks.
fn peak_min(&self) -> ChunkedArray<BooleanType>
fn peak_min(&self) -> ChunkedArray<BooleanType>
Get a boolean mask of the local minimum peaks.
fn is_in(
&self,
_other: &Series
) -> Result<ChunkedArray<BooleanType>, PolarsError>
fn is_in(
&self,
_other: &Series
) -> Result<ChunkedArray<BooleanType>, PolarsError>
Check if elements of this Series are in the right Series, or List values of the right Series.
fn checked_div(&self, _rhs: &Series) -> Result<Series, PolarsError>
Implementations
pub fn unpack<N>(&self) -> Result<&ChunkedArray<N>, PolarsError> where
N: 'static + PolarsDataType,
Trait Implementations
Performs the conversion.
Performs the conversion.