Comments (4)
Sure! Sounds like a fine enhancement. Would you care to give it a go? Also, I'm over here wondering if a bucketized version might help make it more useful for float variables, or do you think that would make it more confusing?
from boltons.
I would restrict a mode
function to discretized values (integers or strings). What you suggest sounds more like a histogram function, such as numpy.histogram
where the user has to say if two values (such as floats) belong to the same bucket or not, either by requesting a given number of buckets or requesting a given bucket width.
I would be more than happy to contribute a patch (never done it before, so bear with me!)
from boltons.
Python >=3.4 comes with the statistics module, providing median, mean, mode, harmonic mean (mentioned in boltons/TODO.rst), variance/standard deviation.
Maybe this means that providing these functions in boltons isn't as urgent, or maybe it means that they can just be backported / copy-and-pasted from the standard library (I believe the Python license is compatible).
from boltons.
Hmm, the 3.4+ stdlib version is pretty simplistic. It doesn't really encapsulate the dataset-based approach (with caching, etc.). It also inexplicably introduces the complexity of sample-based statistics by applying Bessel's correction all over the place, when most simple applications are safe to presume population-based approaches. But, after stripping away those two design oversights, if you still find something worth cribbing, would be happy to include it! I still hear from many Python <3.4 boltons users all the way back to Python 2.6, and they're always happy to have more features. :)
from boltons.
Related Issues (20)
- Convert list of dict items to list of string items
- `ParsedException.from_string(text).to_string() == text` property violated due to anchors
- `boltons.ecoutils` `23.0.0` breaks `pdb` interactive prompt in `pytest` debug sessions HOT 4
- Non-empty `dictutils.OMD` cannot be loaded from `pickle` HOT 1
- RFC: Make boltons Python 3.7+ only. HOT 8
- Support in-place union for `dictutils.OrderedMultiDict` HOT 1
- [Feature request] Parametrize the delimiter to make glom use any kind of Path delimiter, not just `.` HOT 1
- wraps loses keywords
- chunked filter HOT 3
- tracking some ideas HOT 3
- LRU .values() and dict return old entries HOT 3
- call _orig_default identity
- Names in `boltons.strutils.__all__` with no definitions
- Missing git tags for 23.1.0 & 23.1.1 releases HOT 1
- iterutils.get_path has undocumented path as string parameter HOT 1
- 23.1.1: pytest (8.1.0) fail HOT 3
- Build fails with Python 3.13 HOT 6
- research should accept remap args HOT 3
- Python 3.12 warning: Use of naïve datetimes is deprecated HOT 1
- Type hints HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boltons.