info() Method | Teradata Python Package - info() Method - Teradata Package for Python

Teradata® Package for Python User Guide

Product
Teradata Package for Python
Release Number
17.10
Published
May 2022
Language
English (United States)
Last Update
2022-08-18
dita:mapPath
rsu1641592952675.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
B700-4006
lifecycle
previous
Product Category
Teradata Vantage

The info() function prints a summary of the DataFrame.

Optional arguments:
  • verbose specifies whether to print full summary or short summary.
    • If set to True, prints full summary.
    • If set to False, prints short summary.
  • buf specifies the writable buffer to send the output to.

    By default, the output is sent to sys.stdout.

  • max_cols specifies the maximum number of columns allowed for printing the full summary.
  • null_counts specifies whether to show the non-null counts. Display the counts if null_counts is True, otherwise do not display the non-null counts.

Example 1: Print information on DataFrame

This example prints information for DataFrame "sales".
>>> df = DataFrame("sales")

>>> df.info()
<class 'teradataml.dataframe.dataframe.DataFrame'>
Data columns (total 6 columns):
accounts              str
Feb                 float
Jan                   int
Mar                   int
Apr                   int
datetime    datetime.date
dtypes: str(1), float(1), int(3), datetime.date(1)

Example 2: Print a count of non-null values

This example set null_counts to True for a count of non-null values.
>>> df.info(null_counts=True)
<class 'teradataml.dataframe.dataframe.DataFrame'>
Data columns (total 6 columns):
accounts    6 non-null str
Feb         6 non-null float
Jan         4 non-null int
Mar         4 non-null int
Apr         4 non-null int
datetime    6 non-null datetime.date
dtypes: str(1), float(1), int(3), datetime.date(1)

Example 3: Print a short summary

This example set verbose to False for a short summary.
>>> df.info(verbose=False)
<class 'teradataml.dataframe.dataframe.DataFrame'>
Data columns (total 6 columns):
dtypes: str(1), float(1), int(3), datetime.date(1)