In article 6ca71455-2fb2-4dd0-a500-2a480d815...@v6g2000vbb.googlegroups.com,
Raymond Hettinger pyt...@rcn.com wrote:
For edge-triggered events, we need to convert a boundary-event
predicate to groupby-style key function. The code below encapsulates
that process in a new itertool called
On Mar 7, 8:47 pm, Raymond Hettinger pyt...@rcn.com wrote:
The existing groupby() itertool works great when every element in a
group has the same key, but it is not so handy when groups are
determined by boundary conditions.
For edge-triggered events, we need to convert a boundary-event
On Mar 7, 8:47 pm, Raymond Hettinger pyt...@rcn.com wrote:
The existing groupby() itertool works great when every element in a
group has the same key, but it is not so handy when groups are
determined by boundary conditions.
For edge-triggered events, we need to convert a boundary-event
On Mar 9, 6:55 pm, Raymond Hettinger pyt...@rcn.com wrote:
[prueba]
The data often contains objects with attributes instead of tuples, and
I expect the new namedtuple datatype to be used also as elements of
the list to be processed.
But I haven't found a nice generalized way for that
On Mar 7, 7:58 pm, bearophileh...@lycos.com wrote:
Raymond Hettinger, maybe it can be useful to add an optional argument
flag to tell such split_on to keep the separators or not? This is the
xsplit I usually use:
In your experiences with xsplit(), do most use cases involve removing
the
Raymond Hettinger:
In your experiences with xsplit(), do most use cases involve removing the
separators?
Unfortunately I am not able to tell you how often I remove them. But
regarding strings, I usually want to remove separators:
aXcdXfg.split(X)
['a', 'cd', 'fg']
So sometimes I want to do
On Mar 7, 8:47 pm, Raymond Hettinger pyt...@rcn.com wrote:
The existing groupby() itertool works great when every element in a
group has the same key, but it is not so handy when groups are
determined by boundary conditions.
For edge-triggered events, we need to convert a boundary-event
[prueba]
The data often contains objects with attributes instead of tuples, and
I expect the new namedtuple datatype to be used also as elements of
the list to be processed.
But I haven't found a nice generalized way for that kind of pattern
that aggregates from a list of one datatype to a
On Mar 7, 8:47 pm, Raymond Hettinger pyt...@rcn.com wrote:
The existing groupby() itertool works great when every element in a
group has the same key, but it is not so handy when groups are
determined by boundary conditions.
For edge-triggered events, we need to convert a boundary-event
The existing groupby() itertool works great when every element in a
group has the same key, but it is not so handy when groups are
determined by boundary conditions.
For edge-triggered events, we need to convert a boundary-event
predicate to groupby-style key function. The code below
Raymond Hettinger, maybe it can be useful to add an optional argument
flag to tell such split_on to keep the separators or not? This is the
xsplit I usually use:
def xsplit(seq, key=bool, keepkeys=True):
xsplit(seq, key=bool, keepkeys=True): given an iterable seq and
a predicate
key,
11 matches
Mail list logo