qdesc 0.1.8.5__tar.gz → 0.1.9__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.
Potentially problematic release.
This version of qdesc might be problematic. Click here for more details.
- {qdesc-0.1.8.5 → qdesc-0.1.9}/PKG-INFO +8 -2
- {qdesc-0.1.8.5 → qdesc-0.1.9}/qdesc/__init__.py +41 -0
- {qdesc-0.1.8.5 → qdesc-0.1.9}/qdesc.egg-info/PKG-INFO +8 -2
- {qdesc-0.1.8.5 → qdesc-0.1.9}/setup.py +1 -1
- {qdesc-0.1.8.5 → qdesc-0.1.9}/LICENCE.txt +0 -0
- {qdesc-0.1.8.5 → qdesc-0.1.9}/README.md +0 -0
- {qdesc-0.1.8.5 → qdesc-0.1.9}/qdesc.egg-info/SOURCES.txt +0 -0
- {qdesc-0.1.8.5 → qdesc-0.1.9}/qdesc.egg-info/dependency_links.txt +0 -0
- {qdesc-0.1.8.5 → qdesc-0.1.9}/qdesc.egg-info/top_level.txt +0 -0
- {qdesc-0.1.8.5 → qdesc-0.1.9}/setup.cfg +0 -0
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: qdesc
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.9
|
|
4
4
|
Summary: Quick and Easy way to do descriptive analysis.
|
|
5
5
|
Author: Paolo Hilado
|
|
6
6
|
Author-email: datasciencepgh@proton.me
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
License-File: LICENCE.txt
|
|
9
|
+
Dynamic: author
|
|
10
|
+
Dynamic: author-email
|
|
11
|
+
Dynamic: description
|
|
12
|
+
Dynamic: description-content-type
|
|
13
|
+
Dynamic: license-file
|
|
14
|
+
Dynamic: summary
|
|
9
15
|
|
|
10
16
|
# qdesc - Quick and Easy Descriptive Analysis
|
|
11
17
|
|
|
@@ -40,6 +40,47 @@ def desc(df):
|
|
|
40
40
|
x_df = np.round(pd.concat([xl, mad_df, xr, anderson_df], axis=1),2)
|
|
41
41
|
return x_df
|
|
42
42
|
|
|
43
|
+
|
|
44
|
+
def grp_desc(df, numeric_col, group_col):
|
|
45
|
+
import pandas as pd
|
|
46
|
+
import numpy as np
|
|
47
|
+
from scipy.stats import median_abs_deviation, anderson
|
|
48
|
+
results = []
|
|
49
|
+
for group, group_df in df.groupby(group_col):
|
|
50
|
+
data = group_df[numeric_col].dropna()
|
|
51
|
+
if len(data) < 2:
|
|
52
|
+
# Not enough data for stats like std or AD test
|
|
53
|
+
stats = {
|
|
54
|
+
group_col: group,
|
|
55
|
+
'count': len(data),
|
|
56
|
+
'mean': np.nan,
|
|
57
|
+
'std': np.nan,
|
|
58
|
+
'median': np.nan,
|
|
59
|
+
'mad': np.nan,
|
|
60
|
+
'min': np.nan,
|
|
61
|
+
'max': np.nan,
|
|
62
|
+
'anderson_stat': np.nan,
|
|
63
|
+
'crit_5%': np.nan,
|
|
64
|
+
'crit_1%': np.nan
|
|
65
|
+
}
|
|
66
|
+
else:
|
|
67
|
+
ad_result = anderson(data, dist='norm')
|
|
68
|
+
stats = {
|
|
69
|
+
group_col: group,
|
|
70
|
+
'count': len(data),
|
|
71
|
+
'mean': data.mean(),
|
|
72
|
+
'std': data.std(),
|
|
73
|
+
'median': data.median(),
|
|
74
|
+
'mad': median_abs_deviation(data),
|
|
75
|
+
'min': data.min(),
|
|
76
|
+
'max': data.max(),
|
|
77
|
+
'anderson_stat': ad_result.statistic,
|
|
78
|
+
'crit_5%': ad_result.critical_values[2], # 5% is the third value
|
|
79
|
+
'crit_1%': ad_result.critical_values[3], # 1% is the fourth value
|
|
80
|
+
}
|
|
81
|
+
results.append(stats)
|
|
82
|
+
return np.round(pd.DataFrame(results),2)
|
|
83
|
+
|
|
43
84
|
def freqdist(df, column_name):
|
|
44
85
|
import pandas as pd
|
|
45
86
|
if column_name not in df.columns:
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: qdesc
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.9
|
|
4
4
|
Summary: Quick and Easy way to do descriptive analysis.
|
|
5
5
|
Author: Paolo Hilado
|
|
6
6
|
Author-email: datasciencepgh@proton.me
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
8
|
License-File: LICENCE.txt
|
|
9
|
+
Dynamic: author
|
|
10
|
+
Dynamic: author-email
|
|
11
|
+
Dynamic: description
|
|
12
|
+
Dynamic: description-content-type
|
|
13
|
+
Dynamic: license-file
|
|
14
|
+
Dynamic: summary
|
|
9
15
|
|
|
10
16
|
# qdesc - Quick and Easy Descriptive Analysis
|
|
11
17
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|