verticapy.vDataColumn.isbool#
- vDataColumn.isbool() bool #
Returns True if the vDataColumn is boolean, False otherwise.
Returns#
- bool
True if the vDataColumn is boolean.
Examples#
We import
verticapy
:import verticapy as vp
Hint
By assigning an alias to
verticapy
, we mitigate the risk of code collisions with other libraries. This precaution is necessary because verticapy 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 fromverticapy
are used as intended without interfering with functions from other libraries.Let’s create a small dataset:
data = vp.vDataFrame( { "empid": [1, 2, 3, 4], "is_temp": [True, False, False, True], } ) data
123empidInteger100%010is_tempBoolean100%1 1 ✅ 2 2 ❌ 3 3 ❌ 4 4 ✅ Let’s check if data type of “is_temp” vcolumn is bool or not.
data["is_temp"].isbool() Out[2]: True
Let’s check if data type of “empid” vcolumn is bool or not.
data["empid"].isbool() Out[3]: False