-
Notifications
You must be signed in to change notification settings - Fork 76
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
IndexError: indices are out-of-bounds #10
Comments
@mbeyeler Hello and thank you for raising this issue. It is an important use case, especially in the scenario where the data is train and test set split. I have made a note to address it for future builds! |
I have the "IndexError: list assignment index out of range" error but reseting the index did not seem to solve the issue |
I am having same issue as @sherryxiaa . It seems to work with the housing dataset provided in the examples, but not on my own dataframes. I have tried to perform a reset_index() operation but this does not fix it. I can attempt to reproduce this using the housing dataset so that you too can investigate. |
I was having the same error but after i did a Ex:
|
I am running into this issue as well. My index is I tried the approaches in this thread but none of them worked for me.
@mbeyeler @jesperbruunhansen @BrutishGuy @sherryxiaa were you able to fix this issue? |
@nickkunz any thoughts on this? |
I have encountered 2 types of indexing errors, one out-of-bounds which I was able to fix using index_reset() and another error "index out of range" as indicated in a couple of the posts above. That one I have not been able to work around. I encounter this error here: File ~\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\smogn\smoter.py:240, in smoter(data, y, k, pert, samp_method, under_samp, drop_na_col, drop_na_row, replace, rel_thres, rel_method, rel_xtrm_type, rel_coef, rel_ctrl_pts_rg) IndexError: list assignment index out of range Any thoughts on how to fix/work around it are appreciated. |
I also encountered the same issue, and upon checking, it seems that the problem lies in the dist_metrics.py file. In the heom_dist function, the dist list is initialized with |
Hi Nick,
Great package!
I just ran into an
IndexError
when the DataFrame index values are not from aRangeIndex
. I would imagine this to happen quite often if the user passes in training data from a shuffled train-test split.Code to reproduce the error:
smogn.smoter(housing[housing.index > 10].reset_index(), 'SalePrice')
fixes it, but is not necessarily desirable because I would like (need) to preserve the original index.Best,
Michael
The text was updated successfully, but these errors were encountered: