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

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

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)