info() Method

Teradata® Python Package User Guide

brand
Teradata Vantage
prodname
Teradata Python Package
vrm_release
16.20
category
User Guide
featnum
B700-4006-098K

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

The function takes the following optional arguments:
  • verbose: Print full summary if verbose is True or print the short summary if False.
  • buf: The writable buffer to send the output to. By default, the output is sent to sys.stdout.
  • max_cols: 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: 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: 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: 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)