vastorbit.VastFrame.isin¶
- VastFrame.isin(val: dict) VastFrame¶
Checks whether specific records are in the VastFrame and returns the new VastFrame of the search.
- Parameters:
val (dict) – Dictionary of the different records. Each key of the dictionary must represent a VastColumn. For example, to check if Badr Ouali and Fouad Teban are in the VastFrame. You can write the following dict:
{"name": ["Teban", "Ouali"], "surname": ["Fouad", "Badr"]}- Returns:
The VastFrame of the search.
- Return type:
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 fromvastorbitare 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'], } )
123valIntegerAbccatVarchar(1)1 10 C 2 23 C 3 3 A 4 4 B 5 12 A 6 5 A Rows: 1-6 | Columns: 2Note
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
isinwe can easily filter through to get the desired results:vdf.isin({"cat": ['A'], "val": [12]})
123valIntegerAbccatVarchar(1)1 12 A Rows: 1-1 | Columns: 2