Skip to main content

Transform

Allows users to apply a transformation to the data.

Parameters

1. Args

Function Signature

app.mosaic(
vg.transforms.argmax()
)

app.mosaic(
vg.transforms.argmin()
)
ParameterDescription
argmax (List[Union[str, float, bool]])An argmax aggregate transform.
argmin (List[Union[str, float, bool]])An argmin aggregate transform.

2. Avg

Function Signature

app.mosaic(
vg.transforms.avg()
)
ParameterDescription
avg (Union[Union[str, float, bool], List[Union[str, float, bool]]])An averag(mean) value of the given column

3. Bin

Function Signature

app.mosaic(
vg.transforms.bin(
interval, step, steps,
minstep, nice, offset
)
)

A. Bin Options

ParameterDescription
interval (BinInterval)The interval bin unit to use, typically used to indicate a date/time
unit for binning temporal values, such as hour, day, or month.
If date, the extent of data values is used to automatically select
an interval for temporal data. The value number enforces normal
numerical binning, even over temporal data. If unspecified, defaults
to number for numerical data and date for temporal data.
step (Union[int, float])The step size to use between bins. When binning numerical values (or
interval type number), this setting specifies the numerical step size.
For data/time intervals, this indicates the number of steps of that unit,
such as hours, days, or years.
steps (Union[int, float])The target number of binning steps to use. To accommodate human-friendly
("nice") bin boundaries, the actual number of bins may diverge from this
exact value. This option is ignored when step is specified.
minstep (Union[int, float])The minimum allowed bin step size (default 0) when performing numerical
binning. For example, a setting of 1 prevents step sizes less than 1.
This option is ignored when step is specified.
nice (bool)A flag requesting "nice" human-friendly step sizes (default true).
offset (Union[int, float])Offset for computed bins (default 0). For example, a value of 1 will
result in using the next consecutive bin boundary.

B. Bin

Function Signature

app.mosaic(
vg.transforms.bin()
)
ParameterDescription
bin (Union[Union[str, float, bool], List[Union[str, float, bool]]])Bin a continuous variable into discrete intervals. The col argument specifies a data column or expression to bin. Both numerical and temporal (date/time) values are supported.

4. Centroid

Function Signature

app.mosaic(
vg.transforms.centroid()
)
app.mosaic(
vg.transforms.centroidX()
)
app.mosaic(
vg.transforms.centroidY()
)
ParameterDescription
centroid (Union[Union[str, float, bool], List[Union[str, float, bool]]])A centroid transform allows to compute the 2D centroid of geometry-typed data.
centroidX (Union[Union[str, float, bool], List[Union[str, float, bool]]])A centroidX transform allows to compute the centroid x-coordinate of geometry-typed data.
centroidY (Union[Union[str, float, bool], List[Union[str, float, bool]]])A centroidY transform allows to compute the centroid y-coordinate of geometry-typed data.

5. Count

Function Signature

app.mosaic(
vg.transforms.count()
)
ParameterDescription
count (Union[None, Union[Union[str, float, bool], List[Union[str, float, bool]]]])Computes the count of records in an aggregation group.

6. Covariance

Function Signature

app.mosaic(
vg.transforms.covariance()
)
app.mosaic(
vg.transforms.covarPop()
)
ParameterDescription
covariance (List[Union[str, float, bool]])Compute the sample covariance of between the given columns.
covarPop (List[Union[str, float, bool]])Compute the population covariance of between the given columns.

7. CumeDist

Function Signature

app.mosaic(
vg.transforms.cume_dist()
)
ParameterDescription
cume_dist (Union[str, float, bool])A cume_dist window transform which computes the cumulative distribution value over an ordered window partition. Equals the number of partition rows preceding or peer with the current row, divided by the total number of partition rows.

8. Date_Day

Function Signature

app.mosaic(
vg.transforms.dateDay()
)
ParameterDescription
dateDay (Union[Union[str, float, bool], List[Union[str, float, bool]]])Transform a Date value to a day of the month for cyclic comparison. Year and month values are collapsed to enable comparison over days only.

9. Date_Month_Day

Function Signature

app.mosaic(
vg.transforms.dateMonthDay()
)
ParameterDescription
dateMonthDay (Union[Union[str, float, bool], List[Union[str, float, bool]]])Transform a Date value to a month and day boundary for cyclic comparison.Year values are collapsed to enable comparison over months and days only.

10. Date_Month

Function Signature

app.mosaic(
vg.transforms.dateMonth()
)
ParameterDescription
dateMonth (Union[Union[str, float, bool], List[Union[str, float, bool]]])Transform a Date value to a month boundary for cyclic comparison. Year values are collapsed to enable comparison over months only.

11. First

Function Signature

app.mosaic(
vg.transforms.first()
)
ParameterDescription
first (Union[Union[str, float, bool], List[Union[str, float, bool]]])Return the first column value found in an aggregation group.

12. GeoJson

Function Signature

app.mosaic(
vg.transforms.geo_json()
)
ParameterDescription
geojson (Union[Union[str, float, bool], List[Union[str, float, bool]]])Compute a GeoJSON-formatted string from geometry-typed data.

13. Lag_Lead

Function Signature

app.mosaic(
vg.transforms.lag()
)
app.mosaic(
vg.transforms.lead()
)
ParameterDescription
lag (Union[Union[str, float, bool], List[Union[str, float, bool]]])A lag window transform - Returns the value at the row that is offset (second argument, default 1) rows before the current row within the window frame. If there is no such row, instead return default (third argument, default null). Both offset and default are evaluated with respect to the current row.
lead (Union[Union[str, float, bool], List[Union[str, float, bool]]])A lead window transform - Returns the value at the row that is offset (second argument, default 1) rows after the current row within the window frame. If there is no such row, instead return default (third argument, default null). Both offset and default are evaluated with respect to the current row.

14. Last

Function Signature

app.mosaic(
vg.transforms.last()
)
ParameterDescription
first (Union[Union[str, float, bool], List[Union[str, float, bool]]])Return the last column value found in an aggregation group.

15. Max

Function Signature

app.mosaic(
vg.transforms.max()
)
ParameterDescription
max (Union[Union[str, float, bool], List[Union[str, float, bool]]])Compute the maximum value of the given column.

16. Median

Function Signature

app.mosaic(
vg.transforms.median()
)
ParameterDescription
median (Union[Union[str, float, bool], List[Union[str, float, bool]]])Compute the median value of the given column.

17. Min

Function Signature

app.mosaic(
vg.transforms.min()
)
ParameterDescription
min (Union[Union[str, float, bool], List[Union[str, float, bool]]])Compute the minimum value of the given column.

18. Mode

Function Signature

app.mosaic(
vg.transforms.mode()
)
ParameterDescription
mode (Union[Union[str, float, bool], List[Union[str, float, bool]]])Compute the mode value of the given column.

19. Nth Value

Function Signature

app.mosaic(
vg.transforms.first_value()
)

app.mosaic(
vg.transforms.last_value()
)

app.mosaic(
vg.transforms.nth_value()
)

ParameterDescription
first_value (Union[Union[str, float, bool], List[Union[str, float, bool]]])Get the first value of the given column in the current window frame.
last_value (Union[Union[str, float, bool], List[Union[str, float, bool]]])Get the last value of the given column in the current window frame.
nth_value (Union[Union[str, float, bool], List[Union[str, float, bool]]])Get the nth value of the given column in the current window frame, counting from one. The second argument is the offset for the nth row.

20. Ntile

Function Signature

app.mosaic(
vg.transforms.ntile()
)
ParameterDescription
ntile (Union[Union[str, float, bool], List[Union[str, float, bool]]])Compute an n-tile integer ranging from 1 to the provided argument (num_buckets), dividing the partition as equally as possible.

21. Product

Function Signature

app.mosaic(
vg.transforms.product()
)
ParameterDescription
product (Union[Union[str, float, bool], List[Union[str, float, bool]]])Compute the product of the given column.

22. Quantile

Function Signature

app.mosaic(
vg.transforms.quantile()
)
ParameterDescription
quantile (List[Union[str, float, bool]])Compute the quantile value of the given column at the provided probability threshold. For example, 0.5 is the median.

23. Ranks

Function Signature

app.mosaic(
vg.transforms.rank()
)

app.mosaic(
vg.transforms.dense_rank()
)

app.mosaic(
vg.transforms.percent_rank()
)

ParameterDescription
rank (Union[None, Union[Union[str, float, bool], List[Union[str, float, bool]]]])A window function that returns the rank of the current row with gaps, same as the row_number of its first peer.
dense_rank (Union[Union[str, float, bool], List[Union[str, float, bool]]])A window function that returns the rank of the current row without gaps, counting peer groups.
percent_rank (Union[Union[str, float, bool], List[Union[str, float, bool]]])A window function that returns the relative rank of the current row, calculated as (rank() - 1) / (total partition rows - 1).

24. Row_Number

Function Signature

app.mosaic(
vg.transforms.row_number()
)
Parameter (Type)Description
row_number (Union[None, Union[str, float, bool], List[Union[str, float, bool]]])A window function that computes the 1-based row number over an ordered window partition.

25. Shared

Function Signature

app.mosaic(
vg.transforms.shared(
orderby, partitionby, rows,
range, distinct
)
)
Parameter (Type)Description
orderby (Union[TransformField, List[TransformField]])Specifies the fields by which the data should be ordered in the window transform.
partitionby (Union[TransformField, List[TransformField]])Defines the fields used to partition the data in the window transform.
rows (Union[List[Optional[Union[int, float]]], Parameter])Specifies the row offset range for the window function.
range (Union[List[Optional[Union[int, float]]], Parameter])Specifies the range of values for the window function.
distinct (bool)Indicates whether to apply the aggregation only to distinct values in the aggregate transform.

26. StdDev

Function Signature

app.mosaic(
vg.transforms.stddev()
)

app.mosaic(
vg.transforms.stddevPop()
)
ParameterDescription
stddev (Union[Union[str, float, bool], List[Union[str, float, bool]]])A sample standard deviation aggregate transform.
stddevPop (Union[Union[str, float, bool], List[Union[str, float, bool]]])A population standard deviation aggregate transform.

27. Sum

Function Signature

app.mosaic(
vg.transforms.sum()
)
ParameterDescription
sum (Union[Union[str, float, bool], List[Union[str, float, bool]]])Compute the sum of the given column.

28. Variance

Function Signature

app.mosaic(
vg.transforms.variance()
)

app.mosaic(
vg.transforms.varPop()
)
ParameterDescription
variance (Union[Union[str, float, bool], List[Union[str, float, bool]]])Compute the sample variance of the given column.
varPop (Union[Union[str, float, bool], List[Union[str, float, bool]]])Compute the population variance of the given column.

29. Transform

Function Signature

app.mosaic(
vg.transforms.transform(
orderby, partitionby,
rows, range, distinct
)
)
Parameter (Type)Description
orderby (Union[TransformField, List[TransformField]])Specifies the fields by which the data should be ordered in the window transform.
partitionby (Union[TransformField, List[TransformField]])Defines the fields used to partition the data in the window transform.
rows (Union[List[Optional[Union[int, float]]], Parameter])Specifies the row offset range for the window function.
range (Union[List[Optional[Union[int, float]]], Parameter])Specifies the range of values for the window function.
distinct (bool)Indicates whether to apply the aggregation only to distinct values in the aggregate transform.