On 31/05/2020 18:01, Evan Schalton wrote:
I think you're arguing both sides of the argument -- numpy arrays do
have a lot of similar, related operations (because numpy uses them
internally -- since they're more efficient) which means they're not
fringe.
I'm advocating that the built-in list
On 5/31/2020 12:24 PM, Evan Schalton wrote:
I'm less strictly interested in the & operator explicitly working with a bit
int, but think it'd be great if the was a built-in filter something like:
[1,2,3,4] & [0,0,1,1] => [3,4] OR
[1,2,3,4] & [False, False, True, True] = [3,4]
Leaving numpy
I think you're arguing both sides of the argument -- numpy arrays do have a lot
of similar, related operations (because numpy uses them internally -- since
they're more efficient) which means they're not fringe.
I'm advocating that the built-in list class add the efficient, convenience
methods
Evan Schalton wrote:
> Peter,
>
> This isn't a ram consideration as much it's a logical consideration. There
> are a lot of ways to handle this, I REALLY don't want to use a package
> here. Bit masking is incredibly useful for permutations/combinatoric
> algorithms. I can create my own class
Peter,
This isn't a ram consideration as much it's a logical consideration. There are
a lot of ways to handle this, I REALLY don't want to use a package here. Bit
masking is incredibly useful for permutations/combinatoric algorithms. I can
create my own class wrapper or functions, and
evan.schal...@gmail.com wrote:
> I frequently use binary as bool placeholders and find myself filtering
> lists based on those bools, this seems to have a similar semantic meaning
> as the bit wise ^ or __xor__ operator and could add syntactic sugar to the
> base list class.
>
> Use Case:
>
>
@MRAB,
Yes -- good point, it should be the __and__ operator.
do I need a new class? No, but based on this use case and other formatting
techniques adding a filter method to the list class that takes in either bit
mask or bool list would streamline a lot of code and not change any existing
On 2020-05-30 23:52, evan.schal...@gmail.com wrote:
I frequently use binary as bool placeholders and find myself filtering lists
based on those bools, this seems to have a similar semantic meaning as the bit
wise ^ or __xor__ operator and could add syntactic sugar to the base list class.
Use
I frequently use binary as bool placeholders and find myself filtering lists
based on those bools, this seems to have a similar semantic meaning as the bit
wise ^ or __xor__ operator and could add syntactic sugar to the base list class.
Use Case:
Controlling a stepper at half-step has the
On Tue, Aug 2, 2011 at 5:53 PM, Chris Rebert c...@rebertia.com wrote:
If you /really/ need a sorted mapping datatype, google for
sorteddict (which is quite distinct from OrderedDict).
Or look for a binary search tree or skip list implementation of some
sort; but these aren't commonly used
the source code is as follows
x={}
x['a'] = 11
x['c'] = 19
x['b'] = 13
print x
tmp = sorted(x.items(), key = lambda x:x[0])# increase order by
default, if i want to have a descending order, what should i do?
# after sorted is called, a list will be generated, and the hash list
x is not
On 02/08/11 20:02, smith jack wrote:
the source code is as follows
x={}
x['a'] = 11
x['c'] = 19
x['b'] = 13
print x
tmp = sorted(x.items(), key = lambda x:x[0])# increase order by
default, if i want to have a descending order, what should i do?
# after sorted is called, a list
mapping datatype, google for
sorteddict (which is quite distinct from OrderedDict).
Or look for a binary search tree or skip list implementation of some
sort; but these aren't commonly used in Python, so it may be hard to
find a good one.
Cheers,
Chris
--
http://rebertia.com
--
http://mail.python.org
for
sorteddict (which is quite distinct from OrderedDict).
Or look for a binary search tree or skip list implementation of some
sort; but these aren't commonly used in Python, so it may be hard to
find a good one.
I've found a need for such a thing a couple of times.
Anyway, here are some other
On Tue, 22 Nov 2005 14:03:32 +0100, Fredrik Lundh [EMAIL PROTECTED] wrote:
Shi Mu wrote:
I use Python 2.3 to run the following code:
a=[[1,2],[4,8],[0,3]]
a.sort()
a
[[0, 3], [1, 2], [4, 8]]
I wonder whether the sort function automatically consider the first
element in the list of list as
I use Python 2.3 to run the following code:
a=[[1,2],[4,8],[0,3]]
a.sort()
a
[[0, 3], [1, 2], [4, 8]]
I wonder whether the sort function automatically consider the first
element in the list of list as the sorting criteria or it just happens
to be?
Thanks!
--
Shi Mu wrote:
I use Python 2.3 to run the following code:
a=[[1,2],[4,8],[0,3]]
a.sort()
a
[[0, 3], [1, 2], [4, 8]]
I wonder whether the sort function automatically consider the first
element in the list of list as the sorting criteria or it just happens
to be?
the documentation has the
17 matches
Mail list logo