diff --git a/docs/userman/scenario_features/data-integration/data-node-usage.md b/docs/userman/scenario_features/data-integration/data-node-usage.md index 133d1c985..6bdaba2fc 100644 --- a/docs/userman/scenario_features/data-integration/data-node-usage.md +++ b/docs/userman/scenario_features/data-integration/data-node-usage.md @@ -263,12 +263,11 @@ The following examples represent the results when reading from a CSV data node w === "exposed_type = "pandas"" ```python - pandas.DataFrame - ( - date nb_sales - 0 12/24/2018 1550 - 1 12/25/2018 2315 - 2 12/26/2018 1832 + pandas.DataFrame( + { + "date": ["12/24/2018", "12/25/2018", "12/26/2018"], + "nb_sales": [1550, 2315, 1832] + } ) ``` @@ -285,6 +284,7 @@ The following examples represent the results when reading from a CSV data node w ``` === "exposed_type = SaleRow" + ```python [ SaleRow("12/24/2018", 1550), @@ -293,6 +293,23 @@ The following examples represent the results when reading from a CSV data node w ] ``` + === "exposed_type = polars" + + ```python + polars.DataFrame( + { + "date": ["12/24/2018", "12/25/2018", "12/26/2018"], + "nb_sales": [1550, 2315, 1832] + } + ) + ``` + + !!! warning "Available in Taipy Enterprise edition" + + The Polars exposed type is only available in the Enterprise edition of Taipy. + [Contact us](https://taipy.io/book-a-call){: .tp-btn .tp-btn--accent target='blank' } + + When writing data to a CSV data node, the `CSVDataNode.write()^` method can take several datatype as the input: - list, numpy array @@ -409,12 +426,11 @@ The following examples represent the results when reading from an Excel data nod === "exposed_type = "pandas"" ```python - pandas.DataFrame - ( - date nb_sales - 0 12/24/2018 1550 - 1 12/25/2018 2315 - 2 12/26/2018 1832 + pandas.DataFrame( + { + "date": ["12/24/2018", "12/25/2018", "12/26/2018"], + "nb_sales": [1550, 2315, 1832] + } ) ``` @@ -439,6 +455,22 @@ The following examples represent the results when reading from an Excel data nod ] ``` + === "exposed_type = polars" + + ```python + polars.DataFrame( + { + "date": ["12/24/2018", "12/25/2018", "12/26/2018"], + "nb_sales": [1550, 2315, 1832] + } + ) + ``` + + !!! warning "Available in Taipy Enterprise edition" + + The Polars exposed type is only available in the Enterprise edition of Taipy. + [Contact us](https://taipy.io/book-a-call){: .tp-btn .tp-btn--accent target='blank' } + When writing data to an Excel data node, the `ExcelDataNode.write()^` method can take several datatype as the input: - list, numpy array @@ -557,12 +589,12 @@ node with different _exposed_type_: === "exposed_type = "pandas"" ```python - pandas.DataFrame - ( - ID date nb_sales - 0 1 12/24/2018 1550 - 1 2 12/25/2018 2315 - 2 3 12/26/2018 1832 + pandas.DataFrame( + { + "ID": [1, 2, 3], + "date": ["12/24/2018", "12/25/2018", "12/26/2018"], + "nb_sales": [1550, 2315, 1832] + } ) ``` @@ -587,6 +619,23 @@ node with different _exposed_type_: ] ``` + === "exposed_type = polars" + + ```python + polars.DataFrame( + { + "ID": [1, 2, 3], + "date": ["12/24/2018", "12/25/2018", "12/26/2018"], + "nb_sales": [1550, 2315, 1832] + } + ) + ``` + + !!! warning "Available in Taipy Enterprise edition" + + The Polars exposed type is only available in the Enterprise edition of Taipy. + [Contact us](https://taipy.io/book-a-call){: .tp-btn .tp-btn--accent target='blank' } + When writing data to a SQL Table data node, the `SQLTableDataNode.write()^` method can take several datatype as the input: @@ -927,12 +976,11 @@ The following examples represent the results when read from Parquet data node wi === "exposed_type = "pandas"" ```python - pandas.DataFrame - ( - date nb_sales - 0 12/24/2018 1550 - 1 12/25/2018 2315 - 2 12/26/2018 1832 + pandas.DataFrame( + { + "date": ["12/24/2018", "12/25/2018", "12/26/2018"], + "nb_sales": [1550, 2315, 1832] + } ) ``` @@ -957,12 +1005,29 @@ The following examples represent the results when read from Parquet data node wi ] ``` + === "exposed_type = polars" + + ```python + polars.DataFrame( + { + "date": ["12/24/2018", "12/25/2018", "12/26/2018"], + "nb_sales": [1550, 2315, 1832] + } + ) + ``` + + !!! warning "Available in Taipy Enterprise edition" + + The Polars exposed type is only available in the Enterprise edition of Taipy. + [Contact us](https://taipy.io/book-a-call){: .tp-btn .tp-btn--accent target='blank' } + When writing data to a Parquet data node, the `ParquetDataNode.write()^` method can take several datatype as the input depending on the _exposed type_: - pandas dataframes - numpy arrays - any object, which will be passed to the `pd.DataFrame` constructor (e.g., list of dictionaries) +- polars dataframes (Available in Taipy Enterprise edition only) The following examples will write to the path of the Parquet data node: @@ -1556,11 +1621,7 @@ filtered_data = data_node.filter(("nb_sales", 1550, Operator.EQUAL)) === "exposed_type = "pandas"" ```python - pandas.DataFrame - ( - date nb_sales - 0 12/24/2018 1550 - ) + pandas.DataFrame({"date": ["12/24/2018"], "nb_sales": [1550]}) ``` === "exposed_type = "numpy"" @@ -1576,6 +1637,22 @@ filtered_data = data_node.filter(("nb_sales", 1550, Operator.EQUAL)) [SaleRow("12/24/2018", 1550)] ``` + === "exposed_type = polars" + + ```python + polars.DataFrame( + { + "date": ["12/24/2018"], + "nb_sales": [1550] + } + ) + ``` + + !!! warning "Available in Taipy Enterprise edition" + + The Polars exposed type is only available in the Enterprise edition of Taipy. + [Contact us](https://taipy.io/book-a-call){: .tp-btn .tp-btn--accent target='blank' } + If a list of operators is provided, it is necessary to provide a join operator that will be used to combine the filtered results from the operators. The default join operator is `JoinOperator.AND`. @@ -1600,6 +1677,12 @@ filtered_data = data_node.filter( 0 12/24/2018 1550 1 12/26/2018 1832 ) + pandas.DataFrame( + { + "date": ["12/24/2018", "12/26/2018"], + "nb_sales": [1550, 1832] + } + ) ``` === "exposed_type = "numpy"" @@ -1621,6 +1704,22 @@ filtered_data = data_node.filter( ] ``` + === "exposed_type = polars" + + ```python + polars.DataFrame( + { + "date": ["12/24/2018", "12/26/2018"], + "nb_sales": [1550, 1832] + } + ) + ``` + + !!! warning "Available in Taipy Enterprise edition" + + The Polars exposed type is only available in the Enterprise edition of Taipy. + [Contact us](https://taipy.io/book-a-call){: .tp-btn .tp-btn--accent target='blank' } + In another example, the `DataNode.filter()^` method will return all the records from the data node where the value of the "nb_sales" field is equal to 1550 or greater than 2000. The following examples represent the results when read from a data node with different _exposed_type_: @@ -1637,11 +1736,11 @@ filtered_data = data_node.filter( === "exposed_type = "pandas"" ```python - pandas.DataFrame - ( - date nb_sales - 0 12/24/2018 1550 - 1 12/25/2018 2315 + pandas.DataFrame( + { + "date": ["12/24/2018", "12/25/2018"], + "nb_sales": [1550, 2315] + } ) ``` @@ -1664,6 +1763,22 @@ filtered_data = data_node.filter( ] ``` + === "exposed_type = polars" + + ```python + polars.DataFrame( + { + "date": ["12/24/2018", "12/25/2018"], + "nb_sales": [1550, 2315] + } + ) + ``` + + !!! warning "Available in Taipy Enterprise edition" + + The Polars exposed type is only available in the Enterprise edition of Taipy. + [Contact us](https://taipy.io/book-a-call){: .tp-btn .tp-btn--accent target='blank' } + With Pandas data frame as the exposed type, it is also possible to use pandas indexing and filtering style: