Is Single Value¶
Imports¶
[1]:
from sklearn.datasets import load_iris
import pandas as pd
from deepchecks.checks.integrity.is_single_value import IsSingleValue
Load data¶
[2]:
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
[2]:
a | b | c | d | |
---|---|---|---|---|
0 | 3 | 2 | None | a |
1 | 4 | 2 | None | 4 |
2 | 1 | 2 | None | 6 |
See functionality¶
[3]:
IsSingleValue().run(pd.DataFrame(X))
Single Value in Column
Check if there are columns which have only a single unique value in all rows. Read More...
Additional Outputs
✓ Nothing found
[4]:
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. Read More...
Additional Outputs
The following columns have only one unique value
b | c | |
---|---|---|
Single unique value | 2 | None |
[5]:
sv = IsSingleValue()
sv.run(df)
Single Value in Column
Check if there are columns which have only a single unique value in all rows. Read More...
Additional Outputs
The following columns have only one unique value
b | c | |
---|---|---|
Single unique value | 2 | None |
[6]:
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. Read More...
Additional Outputs
✓ Nothing found