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 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'], "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
AbcempidVarchar(1)AbcdobVarchar(10)AbcdojVarchar(10)123emp_catInteger1 3 1992-01-01 2022-01-01 723 2 2 1988-01-01 2023-01-01 945 3 4 1989-01-01 2023-01-01 799 4 1 1993-01-01 2022-01-01 933 Rows: 1-4 | Columns: 4Let’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.