Loading...

vastorbit.VastColumn.isin

VastColumn.isin(val: Annotated[bool | float | str | timedelta | datetime, 'Python Scalar'] | list, *args) VastFrame

Checks whether specific records are in the VastColumn and returns the new VastFrame of the search.

Parameters:

val (PythonScalar / list) – List of the different records. For example, to check if Badr and Fouad are in the VastColumn, you can write the following list: ["Fouad", "Badr"]

Returns:

The VastFrame of the search.

Return type:

VastFrame

Examples

We import vastorbit:

import vastorbit as vo

Hint

By assigning an alias to vastorbit, we mitigate the risk of code collisions with other libraries. This precaution is necessary because vastorbit uses commonly known function names like “average” and “median”, which can potentially lead to naming conflicts. The use of an alias ensures that the functions from vastorbit are used as intended without interfering with functions from other libraries.

For this example, we will use a dummy dataset:

vdf = vo.VastFrame(
    {
        "val": [3, 4, 5, 10, 12, 23],
        "cat": ['A', 'B', 'A', 'C', 'A', 'C'],
    },
)
123
val
Integer
Abc
cat
Varchar(1)
110C
223C
35A
44B
512A
63A
Rows: 1-6 | Columns: 2

Note

vastorbit offers a wide range of sample datasets that are ideal for training and testing purposes. You can explore the full list of available datasets in the Datasets, which provides detailed information on each dataset and how to use them effectively. These datasets are invaluable resources for honing your data analysis and machine learning skills within the vastorbit environment.

Using isin we can easily filter through to get the desired results:

vdf["cat"].isin('A')
123
val
Integer
Abc
cat
Varchar(1)
13A
25A
312A
Rows: 1-3 | Columns: 2

See also

VastFrame.balance() : Balances the VastFrame.
VastFrame.at_time() : Filters the VastFrame at a specific time.