pub struct Logical<Logical, Physical>(pub ChunkedArray<Physical>, _, pub Option<DataType>) 
where
    Logical: PolarsDataType,
    Physical: PolarsDataType
;
Expand description

Maps a logical type to a a chunked array implementation of the physical type. This saves a lot of compiler bloat and allows us to reuse functionality.

Tuple Fields

0: ChunkedArray<Physical>2: Option<DataType>

Implementations

Construct a new DateChunked from an iterator over NaiveDate.

Format Date with a fmt rule. See chrono strftime/strptime.

Construct a new DateChunked from an iterator over optional NaiveDate.

Format Datetime with a fmt rule. See chrono strftime/strptime.

Construct a new DatetimeChunked from an iterator over NaiveDateTime.

Change the underlying TimeUnit. And update the data accordingly.

Change the underlying TimeUnit. This does not modify the data.

Change the underlying TimeZone. This does not modify the data.

Change the underlying TimeUnit. And update the data accordingly.

Change the underlying TimeUnit. This does not modify the data.

Construct a new DurationChunked from an iterator over ChronoDuration.

Construct a new DurationChunked from an iterator over optional ChronoDuration.

Construct a new TimeChunked from an iterator over NaiveTime.

Construct a new TimeChunked from an iterator over optional NaiveTime.

Methods from Deref<Target = ChunkedArray<T>>

Convert all values to their absolute/positive value.

Append in place. This is done by adding the chunks of other to this ChunkedArray.

See also extend for appends to the underlying memory

Cast a numeric array to another numeric data type and apply a function in place. This saves an allocation.

Extend the memory backed by this array with the values from other.

Different from ChunkedArray::append which adds chunks to this ChunkedArray extent appends the data from other to the underlying PrimitiveArray and thus may cause a reallocation.

However if this does not cause a reallocation, the resulting data structure will not have any extra chunks and thus will yield faster queries.

Prefer extend over append when you want to do a query after a single append. For instance during online operations where you add n rows and rerun a query.

Prefer append over extend when you want to append many times before doing a query. For instance when you read in multiple files and when to store them in a single DataFrame. In the latter case finish the sequence of append operations with a rechunk.

Apply a rolling sum (moving sum) over the values in this array. A window of length window_size will traverse the array. The values that fill this window will (optionally) be multiplied with the weights given by the weights vector. The resulting values will be aggregated to their sum.

Apply a rolling median (moving median) over the values in this array. A window of length window_size will traverse the array. The values that fill this window will (optionally) be weighted according to the weights vector.

Apply a rolling quantile (moving quantile) over the values in this array. A window of length window_size will traverse the array. The values that fill this window will (optionally) be weighted according to the weights vector.

Apply a rolling min (moving min) over the values in this array. A window of length window_size will traverse the array. The values that fill this window will (optionally) be multiplied with the weights given by the weights vector. The resulting values will be aggregated to their min.

Apply a rolling max (moving max) over the values in this array. A window of length window_size will traverse the array. The values that fill this window will (optionally) be multiplied with the weights given by the weights vector. The resulting values will be aggregated to their max.

Apply a rolling custom function. This is pretty slow because of dynamic dispatch.

Apply a rolling var (moving var) over the values in this array. A window of length window_size will traverse the array. The values that fill this window will (optionally) be multiplied with the weights given by the weights vector. The resulting values will be aggregated to their var.

Apply a rolling std (moving std) over the values in this array. A window of length window_size will traverse the array. The values that fill this window will (optionally) be multiplied with the weights given by the weights vector. The resulting values will be aggregated to their std.

Check if all values are true

Check if any value is true

Convert missing values to NaN values.

If data is aligned in a single chunk and has no Null values a zero copy view is returned as an ndarray

If all nested Series have the same length, a 2 dimensional ndarray::Array is returned.

This is an iterator over a ListChunked that save allocations. A Series is: 1. Arc ChunkedArray is: 2. Vec< 3. ArrayRef>

The ArrayRef we indicated with 3. will be updated during iteration. The Series will be pinned in memory, saving an allocation for

  1. Arc<..>
  2. Vec<…>
Warning

Though memory safe in the sense that it will not read unowned memory, UB, or memory leaks this function still needs precautions. The returned should never be cloned or taken longer than a single iteration, as every call on next of the iterator will change the contents of that Series.

Apply a closure F elementwise.

In case the inner dtype DataType::Utf8, the individual items will be joined into a single string separated by separator.

Get the value by index in the sublists. So index 0 would return the first item of every sublist and index -1 would return the last item of every sublist if an index is out of bounds, it will return a None.

Get a hold to an object that can be formatted or downcasted via the Any trait.

Safety

No bounds checks

Get a hold to an object that can be formatted or downcasted via the Any trait.

Sample n datapoints from this ChunkedArray.

Sample a fraction between 0.0-1.0 of this ChunkedArray.

Extract json path, first match Refer to https://goessner.net/articles/JsonPath/

Get the length of the string values.

Check if strings contain a regex pattern

Replace the leftmost (sub)string by a regex pattern

Replace all (sub)strings by a regex pattern

Extract the nth capture group from pattern

Modify the strings to their lowercase equivalent

Modify the strings to their uppercase equivalent

Concat with the values from a second Utf8Chunked

Slice the string values Determines a substring starting from start and with optional length length of each of the elements in array. start can be negative, in which case the start counts from the end of the string.

Get the index of the first non null value in this ChunkedArray.

Get the buffer of bits representing null values

Return if any the chunks in this [ChunkedArray] have a validity bitmap. no bitmap means no null values.

Shrink the capacity of this array to fit it’s length.

Series to ChunkedArray

Unique id representing the number of chunks

A reference to the chunks

Returns true if contains a single chunk and has no null values

Count the null values.

Append arrow array in place.

let mut array = Int32Chunked::new("array", &[1, 2]);
let array_2 = Int32Chunked::new("2nd", &[3]);

array.append(&array_2);
assert_eq!(Vec::from(&array), [Some(1), Some(2), Some(3)])

Get a mask of the null values.

Get a mask of the valid values.

Get data type of ChunkedArray.

Name of the ChunkedArray.

Get a reference to the field.

Rename this ChunkedArray.

Contiguous slice

Get slices of the underlying arrow data. NOTE: null values should be taken into account by the user of these slices as they are handled separately

Get the inner data type of the list.

Apply lhs - self

Apply lhs / self

Apply lhs % self

Apply a rolling mean (moving mean) over the values in this array. A window of length window_size will traverse the array. The values that fill this window will (optionally) be multiplied with the weights given by the weights vector. The resulting values will be aggregated to their mean.

Apply a rolling sum (moving sum) over the values in this array. A window of length window_size will traverse the array. The values that fill this window will (optionally) be multiplied with the weights given by the weights vector. The resulting values will be aggregated to their sum.

Apply a rolling min (moving min) over the values in this array. A window of length window_size will traverse the array. The values that fill this window will (optionally) be multiplied with the weights given by the weights vector. The resulting values will be aggregated to their min.

Apply a rolling max (moving max) over the values in this array. A window of length window_size will traverse the array. The values that fill this window will (optionally) be multiplied with the weights given by the weights vector. The resulting values will be aggregated to their max.

Apply a rolling median (moving median) over the values in this array. A window of length window_size will traverse the array. The values that fill this window will (optionally) be weighted according to the weights vector.

Apply a rolling quantile (moving quantile) over the values in this array. A window of length window_size will traverse the array. The values that fill this window will (optionally) be weighted according to the weights vector.

Apply a rolling mean (moving mean) over the values in this array. A window of length window_size will traverse the array. The values that fill this window will (optionally) be multiplied with the weights given by the weights vector. The resulting values will be aggregated to their mean.

Apply a rolling sum (moving sum) over the values in this array. A window of length window_size will traverse the array. The values that fill this window will (optionally) be multiplied with the weights given by the weights vector. The resulting values will be aggregated to their sum.

Apply a rolling min (moving min) over the values in this array. A window of length window_size will traverse the array. The values that fill this window will (optionally) be multiplied with the weights given by the weights vector. The resulting values will be aggregated to their min.

Apply a rolling max (moving max) over the values in this array. A window of length window_size will traverse the array. The values that fill this window will (optionally) be multiplied with the weights given by the weights vector. The resulting values will be aggregated to their max.

Apply a rolling median (moving median) over the values in this array. A window of length window_size will traverse the array. The values that fill this window will (optionally) be weighted according to the weights vector.

Apply a rolling quantile (moving quantile) over the values in this array. A window of length window_size will traverse the array. The values that fill this window will (optionally) be weighted according to the weights vector.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Extract month from underlying NaiveDate representation. Returns the year number in the calendar date.

Extract month from underlying NaiveDateTime representation. Returns the month number starting from 1.

The return value ranges from 1 to 12.

Extract weekday from underlying NaiveDate representation. Returns the weekday number where monday = 0 and sunday = 6

Returns the ISO week number starting from 1. The return value ranges from 1 to 53. (The last week of year differs by years.)

Extract day from underlying NaiveDate 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.)

Returns the day of year starting from 1.

The return value ranges from 1 to 366. (The last day of year differs by years.)

Extract month from underlying NaiveDateTime representation. Returns the year number in the calendar date.

Extract month from underlying NaiveDateTime representation. Returns the month number starting from 1.

The return value ranges from 1 to 12.

Extract weekday from underlying NaiveDateTime representation. Returns the weekday number where monday = 0 and sunday = 6

Returns the ISO week number starting from 1. The return value ranges from 1 to 53. (The last week of year differs by years.)

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.)

Extract hour from underlying NaiveDateTime representation. Returns the hour number from 0 to 23.

Extract minute from underlying NaiveDateTime representation. Returns the minute number from 0 to 59.

Extract second from underlying NaiveDateTime representation. Returns the second number from 0 to 59.

Extract second from underlying NaiveDateTime representation. 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.

Returns the day of year starting from 1.

The return value ranges from 1 to 366. (The last day of year differs by years.)

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Extract the hours from a Duration

Extract the days from a Duration

Extract the seconds from a Duration

Extract the seconds from a Duration

Extract the milliseconds from a Duration

Extract the nanoseconds from a Duration

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Get data type of ChunkedArray.

Gets AnyValue from LogicalType

Get data type of ChunkedArray.

Gets AnyValue from LogicalType

Get data type of ChunkedArray.

Gets AnyValue from LogicalType

Get data type of ChunkedArray.

Gets AnyValue from LogicalType

Initialize by name and values.

Initialize by name and values.

Initialize by name and values.

Initialize by name and values.

Initialize by name and values.

Initialize by name and values.

Initialize by name and values.

Initialize by name and values.

Format Date with a fmt rule. See chrono strftime/strptime.

Extract hour from underlying NaiveDateTime representation. Returns the hour number from 0 to 23.

Extract minute from underlying NaiveDateTime representation. Returns the minute number from 0 to 59.

Extract second from underlying NaiveDateTime representation. Returns the second number from 0 to 59.

Extract second from underlying NaiveDateTime representation. 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.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.