Giter VIP home page Giter VIP logo

wquantiles's Introduction

wquantiles

Build Status DOI Pypi

Weighted quantiles with Python, including weighted median. This library is based on numpy, which is the only dependence.

The main methods are quantile and median. The input of quantile is a numpy array (data), a numpy array of weights of one dimension and the value of the quantile (between 0 and 1) to compute. The weighting is applied along the last axis. The method median is an alias to quantile(data, weights, 0.5).

wquantiles's People

Contributors

madphysicist avatar mmulqueen avatar nudomarinero avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

wquantiles's Issues

Please Document the Correct Module Name or Add a package-level `__init__`

For your consideration:

This may be obvious in hindsight, but to use wquantiles, you have to import weighted. Not import wquantiles or from wquantiles import .... This is a bit counter-intuitive and not explicitly documented. Took me a while to figure out why python setup.py install was successful but python -c 'import wquantiles' was not.

I do not have any particular problem with doing the import the way it is now, but I think it should be mentioned somewhere in README.md.

Package install broken?

Not sure about this, as I haven't used Python in a while and hence might be doing something wrong, but currently doing pip install wquantiles just adds a a folder named wquantiles-0.3.dist-info to my package folder, which doesn't contain the actual .py files that define the functions.

'list' object has no attribute 'ndim'

Hello,

I am trying to apply the following simple code


wquantiles.median([1,2,3,4,5], weights = [0.15, 0.1, 0.2, 0.3, 0.25])

Unfortunately, I have the following error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-12-1caff6aaa564> in <module>
      6 
      7 # example of the weighted median
----> 8 wquantiles.median([1,2,3,4,5], weights = [[0.15, 0.1, 0.2, 0.3, 0.25]])

/opt/conda/lib/python3.7/site-packages/wquantiles.py in median(data, weights)
     93     Alias for `quantile(data, weights, 0.5)`.
     94     """
---> 95     return quantile(data, weights, 0.5)

/opt/conda/lib/python3.7/site-packages/wquantiles.py in quantile(data, weights, quantile)
     75     """
     76     # TODO: Allow to specify the axis
---> 77     nd = data.ndim
     78     if nd == 0:
     79         TypeError("data must have at least one dimension")

AttributeError: 'list' object has no attribute 'ndim'

Could you help me please? I could not find any documentation.

upload newest version to pip

Would it be possible if you could please upload the newest version to pip? I want to package something which depends on this.

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.