Comments (3)
Hi @Umesh-JNU
Thank you for your report.
I notice that you're directly calling a function called bucket()
. This library, excitertools
does not have such a free-standing function. I assume you're talking about more-itertools.bucket(), which is over here: https://github.com/more-itertools/more-itertools
Nevertheless, I looked into this, using both more-itertools and this library, excitertools. In fact, excitertools simply wraps many of the functions in more-itertools so we would expect the same behaviour in both.
To try to reproduce your example, I did this:
more-itertools
>>> iterable = ['a1', 'b1', 'c1', 'a2', 'b2', 'c2', 'b3']
>>> key = lambda x: x[0]
>>> s = more_itertools.bucket(iterable, key=key)
>>> sorted(s)
['a', 'b', 'c']
>>> list(s['a'])
['a1', 'a2']
excitertools
>>> iterable = ['a1', 'b1', 'c1', 'a2', 'b2', 'c2', 'b3']
>>> b = Iter(iterable).bucket(key=lambda x: x[0])
>>> sorted(b)
['a', 'b', 'c']
>>> list(b['a'])
['a1', 'a2']
Thus, I did not get the error in either case.
Looking more closely at your code, the line that complains is this:
s = bucket(iterable, key=lambda x: x[0])
And the error message given is that 'str' object is not callable
. The only thing on that line appears to be callable is the identifier bucket
, which makes me think that somehow your identifier bucket
has somehow been initialised as a string, and not the function from more-itertools.
If you could provide a short, self-contained example of code that I can run, and produce the error, that will help. Please do not link to a notebook.
from excitertools.
from excitertools.
No worries, I can just close it here 👍🏼
from excitertools.
Related Issues (13)
- In the queue wrapper, make sure we call task_done HOT 1
- Dependabot couldn't authenticate with https://pypi.python.org/simple/
- Add convenience filters
- Reference the "fluent interface" wikipedia page HOT 1
- Add an api for writing results out to a file-like ("collecting" to a file for example) HOT 1
- PyPI package doesn't install HOT 1
- DOC: add nchainz to readme
- DOC: switch to mkdocs
- Add an api for "registering" new iterator methods so that they can take part in chaining HOT 1
- Add reference/link to more-itertools in the docs HOT 1
- Think about error handling like in python-chainz
- Make a status badge that includes all versions here 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 excitertools.