vastorbit.VastFrame.bool_to_int¶
- VastFrame.bool_to_int() VastFrame¶
Converts all booleans VastColumns to integers.
- Returns:
self
- 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.Let’s create a small dataset:
data = vo.VastFrame( { "empid": ['1', '2', '3', '4'], "is_temp": [True, False, False, True], } ) data
AbcempidVarchar(1)0|1is_tempBoolean1 4 ✓ 2 3 ✗ 3 2 ✗ 4 1 ✓ Rows: 1-4 | Columns: 2Let’s change the data type from bool to int.
data.bool_to_int()
AbcempidVarchar(1)123is_tempInteger1 3 0 2 4 1 3 2 0 4 1 1 Rows: 1-4 | Columns: 2