Skip to content
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: positional indexers are out-of-bounds #19

Open
bharatkrishna opened this issue Jun 10, 2021 · 1 comment
Open

IndexError: positional indexers are out-of-bounds #19

bharatkrishna opened this issue Jun 10, 2021 · 1 comment

Comments

@bharatkrishna
Copy link

bharatkrishna commented Jun 10, 2021

I am running this with data as shown in example. And I get IndexError: positional indexers are out-of-bounds.

data.shape
(1000, 15)

rg_mtrx = [

    [35000,  1, 0],  ## over-sample ("minority")
    [125000, 0, 0],  ## under-sample ("majority")
    [200000, 0, 0],  ## under-sample
    [250000, 0, 0],  ## under-sample
]

gal_data_smogn = smogn.smoter(
    
    ## main arguments
    data = X_sample,           ## pandas dataframe
    y = 'y_val',          ## string ('header name')
    k = 7,                    ## positive integer (k < n)
    pert = 0.04,              ## real number (0 < R < 1)
    samp_method = 'balance',  ## string ('balance' or 'extreme')
    drop_na_col = True,       ## boolean (True or False)
    drop_na_row = True,       ## boolean (True or False)
    replace = False,          ## boolean (True or False)

    ## phi relevance arguments
    rel_thres = 0.10,         ## real number (0 < R < 1)
    rel_method = 'manual',    ## string ('auto' or 'manual')
    # rel_xtrm_type = 'both', ## unused (rel_method = 'manual')
    # rel_coef = 1.50,        ## unused (rel_method = 'manual')
    rel_ctrl_pts_rg = rg_mtrx ## 2d array (format: [x, y])
)

When I run this I get the IndexError.

@bentsherman
Copy link

Duplicate of #10, use reset_index() as a quick fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants