bitskitten 0.2.0__tar.gz → 0.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {bitskitten-0.2.0 → bitskitten-0.2.1}/PKG-INFO +1 -1
- {bitskitten-0.2.0 → bitskitten-0.2.1}/__init__.py +1 -1
- {bitskitten-0.2.0 → bitskitten-0.2.1}/bitskitten.egg-info/PKG-INFO +1 -1
- {bitskitten-0.2.0 → bitskitten-0.2.1}/output.py +2 -1
- {bitskitten-0.2.0 → bitskitten-0.2.1}/pyproject.toml +1 -1
- {bitskitten-0.2.0 → bitskitten-0.2.1}/tests/test_smoke.py +8 -0
- {bitskitten-0.2.0 → bitskitten-0.2.1}/LICENSE +0 -0
- {bitskitten-0.2.0 → bitskitten-0.2.1}/README.md +0 -0
- {bitskitten-0.2.0 → bitskitten-0.2.1}/bitskitten.egg-info/SOURCES.txt +0 -0
- {bitskitten-0.2.0 → bitskitten-0.2.1}/bitskitten.egg-info/dependency_links.txt +0 -0
- {bitskitten-0.2.0 → bitskitten-0.2.1}/bitskitten.egg-info/requires.txt +0 -0
- {bitskitten-0.2.0 → bitskitten-0.2.1}/bitskitten.egg-info/top_level.txt +0 -0
- {bitskitten-0.2.0 → bitskitten-0.2.1}/classes.py +0 -0
- {bitskitten-0.2.0 → bitskitten-0.2.1}/input.py +0 -0
- {bitskitten-0.2.0 → bitskitten-0.2.1}/setup.cfg +0 -0
|
@@ -6,7 +6,7 @@ Submodules stay importable on their own (`from bitskitten import output`),
|
|
|
6
6
|
which is also how the zipped drop-in build is used: `from classes import NanFixer`.
|
|
7
7
|
'''
|
|
8
8
|
|
|
9
|
-
__version__ = "0.2.
|
|
9
|
+
__version__ = "0.2.1"
|
|
10
10
|
|
|
11
11
|
from .classes import Digitalize, Encoder, FeatureTrans, NanFixer, SlowPolyLinearReg
|
|
12
12
|
from .input import number
|
|
@@ -45,7 +45,8 @@ def imperfection(df:pd.DataFrame,numeric:bool=False,no_nan:bool=False) -> pd.Dat
|
|
|
45
45
|
return series
|
|
46
46
|
|
|
47
47
|
missing_df = form_series(df.isnull().sum() / len(df),"NA Share")
|
|
48
|
-
|
|
48
|
+
# reduce: equal-length uniques (e.g. a single column) would otherwise expand into a frame
|
|
49
|
+
unique_df = form_series(df.apply(pd.unique, result_type="reduce"),"Values")
|
|
49
50
|
nunique_df = form_series(unique_df.apply(len),"Num. of unique")
|
|
50
51
|
type_df = form_series(df.dtypes,"Type")
|
|
51
52
|
|
|
@@ -59,6 +59,14 @@ def test_imperfection(df):
|
|
|
59
59
|
assert set(O.imperfection(df, numeric=True, no_nan=True).index) == {"age", "fare", "survived"}
|
|
60
60
|
|
|
61
61
|
|
|
62
|
+
|
|
63
|
+
def test_imperfection_equal_uniques():
|
|
64
|
+
# every column has the same number of unique values, a single column included
|
|
65
|
+
one = pd.DataFrame({"a": ["x", None, "y"]})
|
|
66
|
+
assert O.imperfection(one).loc["a", "Num. of unique"] == 3
|
|
67
|
+
two = pd.DataFrame({"a": ["x", None, "y"], "n": [1, 2, None]})
|
|
68
|
+
assert list(O.imperfection(two, numeric=True, no_nan=True).index) == ["a", "n"]
|
|
69
|
+
|
|
62
70
|
def test_multicolumn(df):
|
|
63
71
|
assert O.multicolumn(df.sample(1, random_state=0).T, cols=3) is not None
|
|
64
72
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|