Teradata Package for Python Function Reference on VantageCloud Lake - bitwiseNOT - 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.bitwiseNOT = bitwiseNOT()
- DESCRIPTION:
Function performs a bitwise complement on the binary representation of integer or byte
value in column. The bitwise NOT, or complement, is a unary operation which performs
logical negation on each bit, forming the ones' complement of the specified binary value.
The digits in the argument which were 0 become 1, and vice versa.
ALTERNATE NAMES:
* bitnot
* bitwise_not
RAISES:
TypeError, ValueError, TeradataMlException
RETURNS:
DataFrameColumn
EXAMPLES:
# Load the data to run the example.
>>> load_example_data("dataframe", "bytes_table")
# Create a DataFrame on 'bytes_table' table.
>>> df = DataFrame("bytes_table")
>>> print(df)
byte_col varbyte_col blob_col
id_col
2 b'61' b'616263643132' b'6162636431323233'
1 b'62' b'62717765' b'3331363136323633'
0 b'63' b'627A7863' b'3330363136323633'
# Example1: Performs a bitwise complement operation on "varbyte_col" column and
# pass it as input to DataFrame.assign().
>>> res_df = df.assign(col = df.varbyte_col.bitwiseNOT())
>>> print(res_df)
byte_col varbyte_col blob_col col
id_col
2 b'61' b'616263643132' b'6162636431323233' b'-616263643133'
1 b'62' b'62717765' b'3331363136323633' b'-62717766'
0 b'63' b'627A7863' b'3330363136323633' b'-627A7864'