Coder Social home page Coder Social logo

Comments (2)

gitPrinz avatar gitPrinz commented on July 25, 2024

I switched the first two numbers, so it doesn't fail:

data = pd.Series([8, 1, 9, 10, 9])

But named rows

data = pd.Series({'a': 8, 'b': 1, 'c': 9, 'd': 10, 'e': 9})

give

Traceback (most recent call last):
  File "xxx\lib\site-packages\IPython\core\interactiveshell.py", line 3331, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-37-4ecfcc731723>", line 1, in <module>
    grubbs.test(data, alpha=0.05)
  File "xxx\lib\site-packages\outliers\smirnov_grubbs.py", line 243, in test
    return two_sided_test(data, alpha)
  File "xxx\lib\site-packages\outliers\smirnov_grubbs.py", line 207, in two_sided_test
    return _two_sided_test(data, alpha, OutputType.DATA)
  File "xxx\lib\site-packages\outliers\smirnov_grubbs.py", line 195, in _two_sided_test
    return _test(TwoSidedGrubbsTest, data, alpha, output_type)
  File "xxx\lib\site-packages\outliers\smirnov_grubbs.py", line 191, in _test
    return test_class(data).run(alpha, output_type=output_type)
  File "xxx\lib\site-packages\outliers\smirnov_grubbs.py", line 127, in run
    data = self._delete_item(data, outlier_index)
  File "xxx\lib\site-packages\outliers\smirnov_grubbs.py", line 59, in _delete_item
    return data.drop(index)
  File "xxx\lib\site-packages\pandas\core\series.py", line 4139, in drop
    errors=errors,
  File "xxx\lib\site-packages\pandas\core\generic.py", line 3936, in drop
    obj = obj._drop_axis(labels, axis, level=level, errors=errors)
  File "xxx\lib\site-packages\pandas\core\generic.py", line 3970, in _drop_axis
    new_axis = axis.drop(labels, errors=errors)
  File "xxx\lib\site-packages\pandas\core\indexes\base.py", line 5017, in drop
    raise KeyError(f"{labels[mask]} not found in axis")
KeyError: '[1] not found in axis'

Maybe this is related?

from outlier-utils.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.