DataFrame
Contents
DataFrame#
A Daft DataFrame is a table of data. |
Note
Most DataFrame methods are lazy, meaning that they do not execute computation immediately when invoked. Instead, these operations are enqueued in the DataFrame’s internal query plan, and are only executed when Execution DataFrame methods are called.
Data Manipulation#
Manipulating Columns#
Creates a new DataFrame from the provided expressions, similar to a SQL |
|
Adds a column to the current DataFrame with an Expression, equivalent to a |
|
Drops columns from the current DataFrame by name |
|
Explodes a List column, where every element in each row's List becomes its own row, and all other columns in the DataFrame are duplicated across rows |
Filtering Rows#
Computes unique rows, dropping duplicates |
|
Filters rows via a predicate expression, similar to SQL |
|
Limits the rows in the DataFrame to the first |
Reordering#
Sorts DataFrame globally |
|
Repartitions DataFrame to |
Combining#
Column-wise join of the current DataFrame with an |
Aggregations#
Performs a GroupBy on the DataFrame for aggregation |
|
Performs a global sum on the DataFrame |
|
Performs a global mean on the DataFrame |
|
Performs a global count on the DataFrame |
|
Performs a global min on the DataFrame |
|
Performs a global max on the DataFrame |
|
Perform aggregations on this DataFrame. |
Execution#
Note
These methods will execute the operations in your DataFrame and are blocking.
Materialization#
Executes the entire DataFrame and materializes the results |
Visualization#
Executes enough of the DataFrame in order to display the first |
Writing Data#
Writes the DataFrame as parquet files, returning a new DataFrame with paths to the files that were written |
|
Writes the DataFrame as CSV files, returning a new DataFrame with paths to the files that were written |
Integrations#
Converts the current DataFrame to a pandas DataFrame. |
|
Converts the current DataFrame to a Ray Dataset which is useful for running distributed ML model training in Ray |
|
Converts the current Daft DataFrame to a Dask DataFrame. |
Schema and Lineage#
Prints the LogicalPlan that will be executed to produce this DataFrame. |
|
Returns the Schema of the DataFrame, which provides information about each column |
|
Returns column names of DataFrame as a list of strings. |