DataFrame
struct DataFrame
A contiguous growable collection of Series
that have the same length.
operator !=
pub fn operator !=(self, b: DataFrame): bool
operator !=
pub fn operator !=(self, b: DataFrame): bool
operator ==
pub fn operator ==(self, b: DataFrame): bool
operator ==
pub fn operator ==(self, b: DataFrame): bool
new
pub fn new(columns: [Column], broadcast: bool = false): DataFrame throws PolarsError
Create a DataFrame from columns.
new
pub fn new(columns: [Column], broadcast: bool = false): DataFrame throws PolarsError
Create a DataFrame from columns.
Create a DataFrame from columns.
add_column
pub fn add_column(self, column: Column) throws PolarsError
Add a new column to this DataFrame or replace an existing one.
add_column
pub fn add_column(self, column: Column) throws PolarsError
Add a new column to this DataFrame or replace an existing one.
Add a new column to this DataFrame or replace an existing one.
columns
pub fn columns(self): [Column] throws PolarsError
Returns columns of the DataFrame.
columns
pub fn columns(self): [Column] throws PolarsError
Returns columns of the DataFrame.
Returns columns of the DataFrame.
drop
pub fn drop(self, name: string): DataFrame throws PolarsError
Drop a column by name.
drop
pub fn drop(self, name: string): DataFrame throws PolarsError
Drop a column by name.
Drop a column by name.
This is a pure method and will return a new DataFrame instead of modifying the current one in place.
drop_in_place
pub fn drop_in_place(self, name: string): Column throws PolarsError
Remove a column by name and return the column removed.
drop_in_place
pub fn drop_in_place(self, name: string): Column throws PolarsError
Remove a column by name and return the column removed.
Remove a column by name and return the column removed.
drop_nulls
pub fn drop_nulls(self, subset: [string]? = nil): DataFrame throws PolarsError
Return a new DataFrame where all null values are dropped.
drop_nulls
pub fn drop_nulls(self, subset: [string]? = nil): DataFrame throws PolarsError
Return a new DataFrame where all null values are dropped.
Return a new DataFrame where all null values are dropped.
eq_missing
pub fn eq_missing(self, b: DataFrame): bool
eq_missing
pub fn eq_missing(self, b: DataFrame): bool
explode
pub fn explode(self, columns: [string]): DataFrame throws PolarsError
Explode DataFrame to long format by exploding a column with Lists.
explode
pub fn explode(self, columns: [string]): DataFrame throws PolarsError
Explode DataFrame to long format by exploding a column with Lists.
Explode DataFrame to long format by exploding a column with Lists.
extend
pub fn extend(self, other: DataFrame) throws PolarsError
Extend the memory backed by this DataFrame with the values from other.
extend
pub fn extend(self, other: DataFrame) throws PolarsError
Extend the memory backed by this DataFrame with the values from other.
Extend the memory backed by this DataFrame with the values from other.
Get a reference to the schema fields of the DataFrame.
Get a reference to the schema fields of the DataFrame.
Get a reference to the schema fields of the DataFrame.
fill_null
pub fn fill_null(self, strategy: FillNullStrategy): DataFrame throws PolarsError
[src]
pub fn fill_null(self, strategy: FillNullStrategy): DataFrame throws PolarsError {
return try self._fill_null(strategy as int);
}
Replace null values with one of the following strategies.
fill_null
pub fn fill_null(self, strategy: FillNullStrategy): DataFrame throws PolarsError
[src]
pub fn fill_null(self, strategy: FillNullStrategy): DataFrame throws PolarsError {
return try self._fill_null(strategy as int);
}
Replace null values with one of the following strategies.
Replace null 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)
filter
pub fn filter(self, mask: BooleanChunked): DataFrame throws PolarsError
Take the DataFrame rows by a boolean mask.
filter
pub fn filter(self, mask: BooleanChunked): DataFrame throws PolarsError
Take the DataFrame rows by a boolean mask.
Take the DataFrame rows by a boolean mask.
Get the head of the DataFrame.
Get the head of the DataFrame.
Get the head of the DataFrame.
Get the height of the DataFrame which is the number of rows.
Get the height of the DataFrame which is the number of rows.
Get the height of the DataFrame which is the number of rows.
hstack
pub fn hstack(self, columns: [Column]): DataFrame throws PolarsError
Add multiple Series to a DataFrame.
hstack
pub fn hstack(self, columns: [Column]): DataFrame throws PolarsError
Add multiple Series to a DataFrame.
Add multiple Series to a DataFrame.
The added Series are required to have the same length.
insert_column
pub fn insert_column(self, index: int, column: Column) throws PolarsError
Insert a new column at a given index.
insert_column
pub fn insert_column(self, index: int, column: Column) throws PolarsError
Insert a new column at a given index.
Insert a new column at a given index.
is_duplicated
pub fn is_duplicated(self): BooleanChunked throws PolarsError
Get a mask of all the duplicated rows in the DataFrame.
is_duplicated
pub fn is_duplicated(self): BooleanChunked throws PolarsError
Get a mask of all the duplicated rows in the DataFrame.
Get a mask of all the duplicated rows in the DataFrame.
Returns true
if the DataFrame contains no rows.
Returns true
if the DataFrame contains no rows.
Returns true
if the DataFrame contains no rows.
is_unique
pub fn is_unique(self): BooleanChunked throws PolarsError
Get a mask of all the unique rows in the DataFrame.
is_unique
pub fn is_unique(self): BooleanChunked throws PolarsError
Get a mask of all the unique rows in the DataFrame.
Get a mask of all the unique rows in the DataFrame.
Convert the DataFrame
into a LazyFrame
Convert the DataFrame
into a LazyFrame
Convert the DataFrame
into a LazyFrame
null_count
pub fn null_count(self): DataFrame
Create a new DataFrame that shows the null counts per column.
null_count
pub fn null_count(self): DataFrame
Create a new DataFrame that shows the null counts per column.
Create a new DataFrame that shows the null counts per column.
partition_by
pub fn partition_by(self, cols: [string], include_key: bool = false, stable: bool = false): [DataFrame] throws PolarsError
Split into multiple DataFrames partitioned by groups
partition_by
pub fn partition_by(self, cols: [string], include_key: bool = false, stable: bool = false): [DataFrame] throws PolarsError
Split into multiple DataFrames partitioned by groups
Split into multiple DataFrames partitioned by groups
Removes the last column from the DataFrame and returns it, or None if it is empty.
Removes the last column from the DataFrame and returns it, or None if it is empty.
Removes the last column from the DataFrame and returns it, or None if it is empty.
rename
pub fn rename(self, name: string, new_name: string) throws PolarsError
Rename a column in the DataFrame.
rename
pub fn rename(self, name: string, new_name: string) throws PolarsError
Rename a column in the DataFrame.
Rename a column in the DataFrame.
replace
pub fn replace(self, name: string, new_column: Column) throws PolarsError
replace
pub fn replace(self, name: string, new_column: Column) throws PolarsError
Get a DataFrame with all the columns in reversed order.
Get a DataFrame with all the columns in reversed order.
Get a DataFrame with all the columns in reversed order.
select_column
pub fn select_column(self, name: string): Column throws PolarsError
Select a single column by name.
select_column
pub fn select_column(self, name: string): Column throws PolarsError
Select a single column by name.
Select a single column by name.
select_columns
pub fn select_columns(self, names: [string]): [Column] throws PolarsError
Selected multiple columns by name.
select_columns
pub fn select_columns(self, names: [string]): [Column] throws PolarsError
Selected multiple columns by name.
Selected multiple columns by name.
select_index
pub fn select_index(self, idx: int): Column?
select_index
pub fn select_index(self, idx: int): Column?
Shift the values by a given period and fill the parts that will be empty due to this operation with Nones.
Shift the values by a given period and fill the parts that will be empty due to this operation with Nones.
Shift the values by a given period and fill the parts that will be empty due to this operation with Nones.
Slice the DataFrame along the rows.
Slice the DataFrame along the rows.
Slice the DataFrame along the rows.
sort
pub fn sort(self, by: [string], descending: [bool] = [false], nulls_last: [bool] = [false], multithreaded: bool = true, maintain_order: bool = false, limit: int? = nil) throws PolarsError
[src]
pub fn sort(
self,
by: [string],
descending: [bool] = [false],
nulls_last: [bool] = [false],
multithreaded: bool = true,
maintain_order: bool = false,
limit: int? = nil
) throws PolarsError {
try self._sort(by, descending, nulls_last, multithreaded, maintain_order, limit);
}
Sort the DataFrame by column(s).
sort
pub fn sort(self, by: [string], descending: [bool] = [false], nulls_last: [bool] = [false], multithreaded: bool = true, maintain_order: bool = false, limit: int? = nil) throws PolarsError
[src]
pub fn sort(
self,
by: [string],
descending: [bool] = [false],
nulls_last: [bool] = [false],
multithreaded: bool = true,
maintain_order: bool = false,
limit: int? = nil
) throws PolarsError {
try self._sort(by, descending, nulls_last, multithreaded, maintain_order, limit);
}
Sort the DataFrame by column(s).
Sort the DataFrame by column(s).
sql
pub fn sql(self, query: string, table_name: string = "self"): DataFrame throws PolarsError
Execute a SQL query against the DataFrame.
sql
pub fn sql(self, query: string, table_name: string = "self"): DataFrame throws PolarsError
Execute a SQL query against the DataFrame.
Execute a SQL query against the DataFrame.
Get the tail of the DataFrame.
Get the tail of the DataFrame.
Get the tail of the DataFrame.
take
pub fn take(self, indices: [int] | UInt32Chunked): DataFrame throws PolarsError
[src]
pub fn take(self, indices: [int] | UInt32Chunked): DataFrame throws PolarsError {
switch (let indices = indices.(type)) {
case [int]:
return try self._take_by_array(indices);
case UInt32Chunked:
return try self._take_by_chunked(indices);
}
}
Take [DataFrame
] rows by index values.
take
pub fn take(self, indices: [int] | UInt32Chunked): DataFrame throws PolarsError
[src]
pub fn take(self, indices: [int] | UInt32Chunked): DataFrame throws PolarsError {
switch (let indices = indices.(type)) {
case [int]:
return try self._take_by_array(indices);
case UInt32Chunked:
return try self._take_by_chunked(indices);
}
}
Take [DataFrame
] rows by index values.
Take [DataFrame
] rows by index values.
unique
pub fn unique(self, subset: [string]? = nil, keep: UniqueKeepStrategy = .Any): DataFrame throws PolarsError
[src]
pub fn unique(
self, subset: [string]? = nil, keep: UniqueKeepStrategy = .Any
): DataFrame throws PolarsError {
return try self._unique(subset, keep as int);
}
Drop duplicate rows from a DataFrame.
unique
pub fn unique(self, subset: [string]? = nil, keep: UniqueKeepStrategy = .Any): DataFrame throws PolarsError
[src]
pub fn unique(
self, subset: [string]? = nil, keep: UniqueKeepStrategy = .Any
): DataFrame throws PolarsError {
return try self._unique(subset, keep as int);
}
Drop duplicate rows from a DataFrame.
Drop duplicate rows from a DataFrame.
vstack
pub fn vstack(self, other: DataFrame): DataFrame throws PolarsError
Concatenate a DataFrame to this DataFrame and return as newly allocated DataFrame.
vstack
pub fn vstack(self, other: DataFrame): DataFrame throws PolarsError
Concatenate a DataFrame to this DataFrame and return as newly allocated DataFrame.
Concatenate a DataFrame to this DataFrame and return as newly allocated DataFrame.
write_csv
pub fn write_csv(self, path: string, include_bom: bool = false, include_header: bool = true) throws PolarsError
Write a DataFrame to a CSV file.
write_csv
pub fn write_csv(self, path: string, include_bom: bool = false, include_header: bool = true) throws PolarsError
Write a DataFrame to a CSV file.
Write a DataFrame to a CSV file.
write_parquet
pub fn write_parquet(self, path: string) throws PolarsError
Write a DataFrame to a Parquet file.
write_parquet
pub fn write_parquet(self, path: string) throws PolarsError
Write a DataFrame to a Parquet file.
Write a DataFrame to a Parquet file.