Teradata Package for Python Function Reference on VantageCloud Lake - second - Teradata Package for Python - Look here for syntax, methods and examples for the functions included in the Teradata Package for Python.
Teradata® Package for Python Function Reference on VantageCloud Lake
- Deployment
- VantageCloud
- Edition
- Lake
- Product
- Teradata Package for Python
- Release Number
- 20.00.00.03
- Published
- December 2024
- Language
- English (United States)
- Last Update
- 2024-12-19
- dita:id
- TeradataPython_FxRef_Lake_2000
- Product Category
- Teradata Vantage
- teradataml.dataframe.sql.DataFrameColumn.second = second()
- DESCRIPTION:
Function returns the integer value for seconds in the specified timestamp value in a column as a literal.
RAISES:
TypeError, ValueError, TeradataMlException
RETURNS:
DataFrameColumn
EXAMPLES:
# Load the data to run the example.
>>> load_example_data("dataframe", ["ocean_buoys"])
# Create a DataFrame on 'ocean_buoys' table.
>>> ocean_df = DataFrame.from_table('ocean_buoys')
# Example 1: Returns the integer value for seconds in the specified timestamp value in a column as a literal.
>>> res_df = ocean_df.assign(res = ocean_df.TD_TIMECODE.second())
>>> print(res_df)
TD_TIMECODE salinity temperature res
buoyid
44 2014-01-06 10:00:25.122200 55 43 25.0
44 2014-01-06 10:01:25.122200 55 53 25.0
44 2014-01-06 10:01:25.122200 55 54 25.0
44 2014-01-06 10:02:25.122200 55 53 25.0
44 2014-01-06 10:03:25.122200 55 53 25.0
44 2014-01-06 10:03:25.122200 55 56 25.0
2 2014-01-06 21:01:25.122200 55 80 25.0
2 2014-01-06 21:02:25.122200 55 81 25.0
2 2014-01-06 21:03:25.122200 55 82 25.0
0 2014-01-06 08:00:00.000000 55 10 0.0