Loading...

vastorbit.VastFrame.datecol

VastFrame.datecol() list

Returns a list of the VastColumns of type date in the VastFrame.

Returns:

List of all VastColumns of type date.

Return type:

List

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.

Let’s create a small dataset:

data = vo.VastFrame(
    {
        "empid": ['1', '2', '3', '4'],
        "dob": ['1993-01-01', '1988-01-01', '1992-01-01', '1989-01-01'],
        "doj": ['2022-01-01', '2023-01-01', '2022-01-01', '2023-01-01'],
        "emp_cat":[933, 945, 723, 799],
    }
)
data
Abc
empid
Varchar(1)
Abc
dob
Varchar(10)
Abc
doj
Varchar(10)
123
emp_cat
Integer
131992-01-012022-01-01723
221988-01-012023-01-01945
341989-01-012023-01-01799
411993-01-012022-01-01933
Rows: 1-4 | Columns: 4

Let’s set the data type of dob and doj to date.

data["dob"].astype("date")
data["doj"].astype("date")

Let’s retrieve the date type VastColumns in the dataset.

data.datecol()

See also

VastFrame.catcol() : Returns all VastColumns with categorical values.
VastFrame.numcol() : Returns all VastColumns with numerical values.
VastFrame.get_columns() : Returns all VastColumns.