Is Single Value#

Imports#

import numpy as np
import pandas as pd
from sklearn.datasets import load_iris

from deepchecks.tabular.checks 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


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


sv = IsSingleValue()
sv.run(df)
Single Value in Column


sv_ignore = IsSingleValue(ignore_columns=['b','c'])
sv_ignore.run(df)
Single Value in Column


# Ignoring NaN values

IsSingleValue(ignore_nan=True).run(pd.DataFrame({
    'a': [3, np.nan],
    'b': [2, 2],
    'c': [None, np.nan],
    'd': ['a', 4]
}))
Single Value in Column


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

Gallery generated by Sphinx-Gallery