adviz
Advanced tools
| Metadata-Version: 2.1 | ||
| Name: adviz | ||
| Version: 0.0.16 | ||
| Version: 0.0.17 | ||
| Summary: advertools visualizations | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/eliasdabbas/adviz |
@@ -1,2 +0,2 @@ | ||
| __version__ = "0.0.16" | ||
| __version__ = "0.0.17" | ||
@@ -3,0 +3,0 @@ from .value_counts_plus import value_counts_plus |
@@ -11,2 +11,3 @@ # AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/03_racing_chart.ipynb. | ||
| import adviz | ||
| from IPython.display import display_html | ||
@@ -13,0 +14,0 @@ # %% ../nbs/03_racing_chart.ipynb 4 |
@@ -66,3 +66,3 @@ # AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/02_url_structure.ipynb. | ||
| dir2_valcounts.append(valcountsdf) | ||
| dir2_df = pd.concat(dir2_valcounts, ignore_index=True)[['data', 'count', 'dir_1_value']] | ||
| dir2_df = pd.concat(dir2_valcounts, ignore_index=True)[['dir_2', 'count', 'dir_1_value']] | ||
| treemap_df = pd.merge( | ||
@@ -75,4 +75,4 @@ top_n_df, | ||
| fig = px.treemap( | ||
| treemap_df.dropna(), | ||
| path=[px.Constant(domain), 'dir_1_top_n', 'data'], | ||
| treemap_df.dropna(), | ||
| path=[px.Constant(domain), 'dir_1_top_n', 'dir_2'], | ||
| branchvalues='total', | ||
@@ -79,0 +79,0 @@ maxdepth=2, |
@@ -6,8 +6,10 @@ # AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/00_value_counts_plus.ipynb. | ||
| # %% ../nbs/00_value_counts_plus.ipynb 4 | ||
| # %% ../nbs/00_value_counts_plus.ipynb 3 | ||
| import advertools as adv | ||
| import pandas as pd | ||
| from functools import partial | ||
| # %% ../nbs/00_value_counts_plus.ipynb 5 | ||
| # %% ../nbs/00_value_counts_plus.ipynb 4 | ||
| def value_counts_plus( | ||
| series, | ||
| data, | ||
| dropna=False, | ||
@@ -27,3 +29,3 @@ show_top=10, | ||
| ---------- | ||
| series : pandas Series or list | ||
| series : pandas.Series or pandas.DataFrame | ||
| A sequence of items to count. | ||
@@ -69,9 +71,9 @@ dropna : bool | ||
| raise ValueError(f"Please make sure you use a name other than {final_col_names}") | ||
| val_counts = pd.Series(series).rename(name).value_counts(dropna=dropna).reset_index() | ||
| val_counts.columns = [name, 'count'] | ||
| if not isinstance(data, pd.DataFrame): | ||
| data = pd.Series(data) | ||
| val_counts = data.value_counts(dropna=dropna).reset_index().rename(columns={'index': name}) | ||
| if len(val_counts) > show_top: | ||
| others_df = pd.DataFrame({ | ||
| name: ['Others:'], | ||
| 'count': val_counts[show_top:]['count'].sum() | ||
| }, index=[show_top]) | ||
| others_df = pd.DataFrame( | ||
| [['Others:'] + ['' for i in range(len(val_counts.columns)-2)] + [val_counts[show_top:]['count'].sum()]], | ||
| columns=val_counts.columns) | ||
| val_counts = pd.concat([ | ||
@@ -93,3 +95,3 @@ val_counts[:show_top], | ||
| count_df.index = range(1, len(count_df)+1) | ||
| count_df.columns = [name, 'count', 'cum. count', '%', 'cum. %'] | ||
| count_df = count_df.rename(columns={'cum_count': 'cum. count', 'perc': '%', 'cum_perc': 'cum. %'}) | ||
| return (count_df | ||
@@ -96,0 +98,0 @@ .style |
+1
-1
| Metadata-Version: 2.1 | ||
| Name: adviz | ||
| Version: 0.0.16 | ||
| Version: 0.0.17 | ||
| Summary: advertools visualizations | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/eliasdabbas/adviz |
+1
-1
| [DEFAULT] | ||
| repo = adviz | ||
| lib_name = adviz | ||
| version = 0.0.16 | ||
| version = 0.0.17 | ||
| min_python = 3.7 | ||
@@ -6,0 +6,0 @@ license = apache2 |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
62309
0.34%1423
0.21%