byte_encoding | Display Options | Teradata Python Package - byte_encoding - Teradata Package for Python

Teradata® Package for Python User Guide

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Teradata Package for Python
Release Number
20.00
Published
March 2024
Language
English (United States)
Last Update
2024-04-09
dita:mapPath
nvi1706202040305.ditamap
dita:ditavalPath
plt1683835213376.ditaval
dita:id
rkb1531260709148
Product Category
Teradata Vantage
The byte_encoding option controls the encoding used for printing byte-like types in a DataFrame. The default is Base16. The following encodings are supported:
  • BaseX

    X is a power of 2 (for example, 2, 8, 16).

  • BaseY

    Y is not a power of 2 (for example, 10 and 36).

  • Base64M (MIME)
  • ASCII
The from_bytes function is used to display byte-like types. See Teradata Vantage™ - SQL Functions, Expressions, and Predicates for more information on specifying arguments for FROM_BYTES.

Example: Default is Base16

>>> display.byte_encoding
'base16'
 
 
>>> DataFrame('byte')
 
 
           byte      varbyte         blob
id                                      
2   b'32616263'  b'32616263'  b'32616263'
1   b'31616263'  b'31616263'  b'31616263'
0   b'30616263'  b'30616263'  b'30616263'

Example: Set the value to ascii

>>> display.byte_encoding = 'ascii'
>>> DataFrame('byte')
 
 
       byte  varbyte     blob
id                          
2   b'2abc'  b'2abc'  b'2abc'
1   b'1abc'  b'1abc'  b'1abc'
0   b'0abc'  b'0abc'  b'0abc'