Is Single Value#

Imports#

import pandas as pd
from sklearn.datasets import load_iris

from deepchecks.tabular.checks.integrity.is_single_value import IsSingleValue

Load Data#

iris = load_iris()
X = iris.data
df = pd.DataFrame({'a':[3,4,1], 'b':[2,2,2], 'c':[None, None, None], 'd':['a', 4, 6]})
df
a b c d
0 3 2 None a
1 4 2 None 4
2 1 2 None 6


See functionality#

IsSingleValue().run(pd.DataFrame(X))

Single Value in Column

Check if there are columns which have only a single unique value in all rows.

Additional Outputs

Nothing to display



IsSingleValue().run(pd.DataFrame({'a':[3,4], 'b':[2,2], 'c':[None, None], 'd':['a', 4]}))

Single Value in Column

Check if there are columns which have only a single unique value in all rows.

Additional Outputs
The following columns have only one unique value
  b c
Single unique value 2 None


sv = IsSingleValue()
sv.run(df)

Single Value in Column

Check if there are columns which have only a single unique value in all rows.

Additional Outputs
The following columns have only one unique value
  b c
Single unique value 2 None


sv_ignore = IsSingleValue(ignore_columns=['b','c'])
sv_ignore.run(df)

Single Value in Column

Check if there are columns which have only a single unique value in all rows.

Additional Outputs

Nothing to display



Total running time of the script: ( 0 minutes 0.050 seconds)

Gallery generated by Sphinx-Gallery