Back to bricks list
Introduction Getting Started
Architecture
Technical Documentation
Tasks
Barplot Plotly Boxplot Plotly Conda env agent Converter Create a sugar type of food Create folder from files Create json dict Create lab note Create note resource Create robot Decompress file Describe Download an scenario Download resource from a S3 bucket Download resource from external source Eat task Env agent Extract column tags to new row Extract column values to row tags Extract row tags to new column Extract row values to column tags Fly task Folder exporter Fs node extractor Generate lab note from note resource GenerateStreamlitTestApp Histogram Plotly Input Input from task output JSON Dict exporter JSON Dict importer Line Plotly Mamba env agent Melt Merge note resources Move robot Output Pip env agent Python agent R conda env agent R mamba env agent Resource exporter Resource importer Resource picker Resource set exporter Resource stacker Robot add Scatterplot Plotly Select a scenario Select note Select note template Send a scenario to a lab Send the resource to a lab Shell wait Smart interactive plot generator Smart json transformer Smart multi tables transformer Smart plot generator Smart table transformer Streamlit agent Streamlit conda agent Streamlit env agent Streamlit mamba agent Streamlit pip env agent Switch2 Table column aggregator Table column aggregator filter Table column annotator Table column concat Table column data numeric filter Table column data text filter Table column operation mass Table column operations Table column scaler Table column tag aggregator Table column tag unfolder Table column tags deleter Table column tags selector Table columns deleter Table columns selector Table exporter Table importer Table replace Table row aggregator Table row aggregator filter Table row annotator Table row concat Table row data numeric filter Table row data text filter Table row scaler Table row tag aggregator Table row tag unfolder Table row tags deleter Table row tags selector Table rows deleter Table rows selector Table scaler Table transposer Task Task Plotly Text exporter Text importer The travel of `Astro` Transformer Unzip and load resource Update note resource Upload resource to S3 Viewer Violinplot Plotly Wait Wait task Write to file Zip resource [Support] Update process typing name [Support] Update resource typing name
Version

Table column operation mass

TASK
Typing name :  TASK.gws_core.TableColumnMassOperations Brick :  gws_core

Apply operations stored in table to another table

Task to apply a list of operation contained in a table to another table. This is useful to apply a lot of operations.

The Calculation column config defines operations to apply to the input table.

The input table must not contained special caracters in the column names

Examples

Let's say you have this Table with the column A, B, C, D

A B C D
1 10 11 -9
2 8 10 -6
3 6 9 -3

Here is few example that you can write in the operations column.

  • Addition : A + B + C
  • Constant : A + 10
  • Subtraction : A - C
  • Multiplication : A * C
  • Division : A / C
  • Exponentiation : A ** C
  • Modulus : A % C
  • Floor division : A // C
  • Advanced exemple : (A + B) / (C * D)

Comparaison

This task support comparaison, it will return the string True or False.

Comparaison operators : ==, !=, >, <, >= and <=

Math functions

This task supports basic math functions : sin, cos, exp, log, expm1, log1p, sqrt, sinh, cosh, tanh, arcsin, arccos, arctan, arccosh, arcsinh, arctanh, abs, arctan2 and log10.

Example : log(A)

Only works if Error on unknown column is checked

Error on unknown column

If Error on unknown column is unchecked, the operation will not fail on unknow columns (the result for operations with unknown column will be 'NaN') but only basic operations and comparaison are supported (no functions).

If Error on unknown column is checked, the operation will fail on unknow columns (raise an exception) but it supports all operations.

Input

Input table
Table that contains the data to apply operations on
Operation table
Table that contains the operation's name and operations's calculations

Output

Table
2d excel like table

Configuration

name_column

Optional

Name of the column in Operation Table that contains operations' names. If not provided, the first column will be used

Type : string

calculations_column

Optional

Name of the column in Operation Table that contains operations' calculations. If not provided, the second column will be used

Type : string

keep_original_columns

Optional Advanced parameter

If true, the original columns of the Table will be added at the end of the Table. If false, only the calculcation columns are kept.

Type : bool

unknown_column_option

Optional Advanced parameter

Option to apply when an unknown column is found in the operation table.

Type : stringAllowed values : Error Set result to NaN Replace unknown columns with 0 Default value : Set result to NaN