Loading...

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 from verticapy 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
123
empid
Integer
100%
010
is_temp
Boolean
100%
11
22
33
44

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