Correlation Plot | teradataml - Correlation Plot - 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
December 2024
ft:locale
en-US
ft:lastEdition
2025-01-23
dita:mapPath
nvi1706202040305.ditamap
dita:ditavalPath
plt1683835213376.ditaval
dita:id
rkb1531260709148
Product Category
Teradata Vantage

Use plot() function to generate a correlation plot on DataFrame.

  • X-Axis must be a DataFrame Column.
  • Y-Axis must be a tuple or list of tuples.
    Tuple must contain only two elements. Both elements must be DataFrame Columns.
    • If Y-Axis is a tuple,, a simple correlation plot is generated.
    • If Y-Axis is a list of tuples, a composite correlation plot is generated.

      See Composite Plot for more details.

Example

The following example generates a correlation plot.

The color of this plot is orange and the plot has grid along with custom labels. All of these are additional options for plotting. See Options for Plotting for more details.

  • >>> load_example_data("uaf", ["acf"])
  • >>> df = DataFrame("acf")
    >>> df
        ROW_I     OUT_v  CONF_OFF_v  CONF_LOW_v  CONF_HI_v
    id
    1       2  0.828499    0.484255    0.344244   1.312753
    1       4  0.481562    0.653203   -0.171641   1.134765
    1       5  0.274737    0.682560   -0.407822   0.957297
    1       6  0.064830    0.691846   -0.627016   0.756677
    1       8 -0.310745    0.694562   -1.005307   0.383817
    1       9 -0.454362    0.706218   -1.160581   0.251856
    1       7 -0.134393    0.692360   -0.826753   0.557967
    1       3  0.670858    0.592091    0.078767   1.262949
    1       1  0.941700    0.290772    0.650928   1.232471
    1       0  1.000000    0.000000    1.000000   1.000000
  • >>> df.plot(x=df.ROW_I, y=(df.OUT_v, df.CONF_OFF_v),
                kind='corr', color="orange", grid_color='blood',
                xlabel='xlabel', ylabel='ylabel',grid_linestyle="--")

    Correlation Plot