New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ValueError: index must be monotonic increasing or decreasing #10
Comments
Hi! Thank you for the report. I initially thought the data set was only on Kaggle. Finding an alternate source and will report here on what I find. |
I was able to reproduce the issue, will look for a fix! |
I also get the same error: ValueError("index must be monotonic increasing or decreasing"). ValueError Traceback (most recent call last) ~/anaconda3/envs/python3/lib/python3.6/site-packages/pandas/core/indexes/base.py in _searchsorted_monotonic(self, label, side) ValueError: index must be monotonic increasing or decreasing During handling of the above exception, another exception occurred: KeyError Traceback (most recent call last) ~/anaconda3/envs/python3/lib/python3.6/site-packages/sweetviz/sv_public.py in compare_intra(source_df, condition_series, names, target_feat, feat_cfg, pairwise_analysis) ~/anaconda3/envs/python3/lib/python3.6/site-packages/sweetviz/dataframe_report.py in init(self, source, target_feature_name, compare, pairwise_analysis, fc) ~/anaconda3/envs/python3/lib/python3.6/site-packages/sweetviz/series_analyzer.py in analyze_feature_to_dictionary(to_process) ~/anaconda3/envs/python3/lib/python3.6/site-packages/sweetviz/series_analyzer_cat.py in analyze(to_process, feature_dict) ~/anaconda3/envs/python3/lib/python3.6/site-packages/sweetviz/series_analyzer_cat.py in do_detail_categorical(to_process, updated_dict) ~/anaconda3/envs/python3/lib/python3.6/site-packages/sweetviz/utils.py in get_clamped_value_counts(value_counts, max_categories_incl_other) ~/anaconda3/envs/python3/lib/python3.6/site-packages/pandas/core/series.py in getitem(self, key) ~/anaconda3/envs/python3/lib/python3.6/site-packages/pandas/core/series.py in _get_with(self, key) ~/anaconda3/envs/python3/lib/python3.6/site-packages/pandas/core/series.py in _slice(self, slobj, axis, kind) ~/anaconda3/envs/python3/lib/python3.6/site-packages/pandas/core/indexes/numeric.py in _convert_slice_indexer(self, key, kind) ~/anaconda3/envs/python3/lib/python3.6/site-packages/pandas/core/indexes/base.py in slice_indexer(self, start, end, step, kind) ~/anaconda3/envs/python3/lib/python3.6/site-packages/pandas/core/indexes/base.py in slice_locs(self, start, end, step, kind) ~/anaconda3/envs/python3/lib/python3.6/site-packages/pandas/core/indexes/base.py in get_slice_bound(self, label, side, kind) ~/anaconda3/envs/python3/lib/python3.6/site-packages/pandas/core/indexes/base.py in get_slice_bound(self, label, side, kind) ~/anaconda3/envs/python3/lib/python3.6/site-packages/pandas/core/indexes/numeric.py in get_loc(self, key, method, tolerance) ~/anaconda3/envs/python3/lib/python3.6/site-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance) pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc() pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc() pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.Float64HashTable.get_item() pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.Float64HashTable.get_item() KeyError: 0.0 |
Fix submitted with the latest commit (1.0a7). @phillip1029 @roytaas let me know if that fixed it! Thank you again for the reports! Francois |
I still get the same error |
@roytaas darn; is that with the same Boston dataset? |
It is the same dataset, but i didn't use the boston dataset, but my own dataset :) |
Wel it works on the boston dataset. In my own dataset I have string variables, which I don't see in the boston and titanic set, is that a problem? |
@roytaas string data should be fine and show up as "text". There are all sorts of combinations though so there is something I didn't cover in that particular case. Is this a dataset you would be able to share with me? If so e-mail me at fb at fbdesignpro.com. If not I will look at the call stack again. |
Actually, looking at the code, it has to be a different error (but it could be with the same data); @roytaas could you send the call stack you are getting again? Because you should not be getting the same error on version 1.0a7. |
@fbdesignpro Thank you so much for fixing this. After uninstalling and reinstalling the package, I am getting the right results now. Great job. |
@roytaas let me know if you're still getting this in version 1.0a7. To make sure you are using the latest version you can use |
@fbdesignpro Hi, I am facing the same error even after upgrading it 1.0a7. ValueError Traceback (most recent call last) ~/.local/lib/python3.8/site-packages/pandas/core/indexes/base.py in _searchsorted_monotonic(self, label, side) ValueError: index must be monotonic increasing or decreasing During handling of the above exception, another exception occurred: KeyError Traceback (most recent call last) ~/.local/lib/python3.8/site-packages/sweetviz/sv_public.py in compare(source, compare, target_feat, feat_cfg, pairwise_analysis) ~/.local/lib/python3.8/site-packages/sweetviz/dataframe_report.py in init(self, source, target_feature_name, compare, pairwise_analysis, fc) ~/.local/lib/python3.8/site-packages/sweetviz/series_analyzer.py in analyze_feature_to_dictionary(to_process) ~/.local/lib/python3.8/site-packages/sweetviz/series_analyzer_cat.py in analyze(to_process, feature_dict) ~/.local/lib/python3.8/site-packages/sweetviz/series_analyzer_cat.py in do_detail_categorical(to_process, updated_dict) ~/.local/lib/python3.8/site-packages/sweetviz/utils.py in get_clamped_value_counts(value_counts, max_categories_incl_other) ~/.local/lib/python3.8/site-packages/pandas/core/series.py in getitem(self, key) ~/.local/lib/python3.8/site-packages/pandas/core/series.py in _get_with(self, key) ~/.local/lib/python3.8/site-packages/pandas/core/series.py in _slice(self, slobj, axis, kind) ~/.local/lib/python3.8/site-packages/pandas/core/indexes/numeric.py in _convert_slice_indexer(self, key, kind) ~/.local/lib/python3.8/site-packages/pandas/core/indexes/base.py in slice_indexer(self, start, end, step, kind) ~/.local/lib/python3.8/site-packages/pandas/core/indexes/base.py in slice_locs(self, start, end, step, kind) ~/.local/lib/python3.8/site-packages/pandas/core/indexes/base.py in get_slice_bound(self, label, side, kind) ~/.local/lib/python3.8/site-packages/pandas/core/indexes/base.py in get_slice_bound(self, label, side, kind) ~/.local/lib/python3.8/site-packages/pandas/core/indexes/numeric.py in get_loc(self, key, method, tolerance) ~/.local/lib/python3.8/site-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance) pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc() pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc() pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.Float64HashTable.get_item() pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.Float64HashTable.get_item() KeyError: 0.0 |
@ikunal95 @phillip1029 am I on crazy pills? It looks like my updates are not taking effect on the pyc compiled code or something! (but it seems to update the source for you guys) I wonder if it has to do with how I am uploading builds through
Line 14 has NO code in it, and the call stack you're giving me is consistent with the old version of source. e.g. PREVIOUSLY: (Notice how line 14 no longer exists and that is what I had fixed previously...) Can you try uninstalling then reinstalling the package? Thanks! |
Excelent, you fix the problem qwith the last update, thanks 👍 |
Great, thank you! @phillip1029 @ikunal95 does reinstalling fix it? Looks like "just upgrading" isn't working for some reason... :/ |
Reinstalling fixed the issue for me. Thanks.
…On Tue, Jun 16, 2020, 11:01 AM Francois Bertrand ***@***.***> wrote:
Great, thank you! @phillip1029 <https://github.com/phillip1029> @ikunal95
<https://github.com/ikunal95> does reinstalling fix it? Looks like "just
upgrading" isn't working for some reason... :/
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#10 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABXGCSIRETELOJHKHQJ55KLRW6CLPANCNFSM4NZAOIBA>
.
|
@phillip1029 great! Thank you that makes some sense! I will update the instructions for updating as it seems reinstalling is the way to go. |
I am able to generate the same report on Titanic data as in the Medium articles. However, when I try to test the Boston housing data, I get the errors as below:
ValueError Traceback (most recent call last)
~\AppData\Local\Continuum\anaconda3\envs\envSDS\lib\site-packages\pandas\core\indexes\base.py in get_slice_bound(self, label, side, kind)
5166 try:
-> 5167 return self._searchsorted_monotonic(label, side)
5168 except ValueError:
~\AppData\Local\Continuum\anaconda3\envs\envSDS\lib\site-packages\pandas\core\indexes\base.py in _searchsorted_monotonic(self, label, side)
5127
-> 5128 raise ValueError("index must be monotonic increasing or decreasing")
5129
ValueError: index must be monotonic increasing or decreasing
During handling of the above exception, another exception occurred:
KeyError Traceback (most recent call last)
in
----> 1 my_report = sv.analyze(dfx)
Any ideas on the error?
Thanks.
The text was updated successfully, but these errors were encountered: