On 21Feb2014 09:32, Roy Smith wrote:
> In article ,
> Peter Otten <__pete...@web.de> wrote:
> > [x*x for (x,) in lst]
> >
> > [paraphrasing...] can be better written as:
> >
> > [x*x for [x] in items]
>
> I'm torn between, "Yes, the second form is distinctly easier to read"
> and, "If you think
On 2014-02-21 09:48, Travis Griggs wrote:
> I’ve used the comma form with struct.unpack() frequently:
>
> count, = struct.unpack(‘!I’, self.packet)
This is *especially* one of those places I want extra parens to make
sure I see what's happening. I've been stung too many times by the
easy-to-miss
On Feb 21, 2014, at 6:32 AM, Roy Smith wrote:
> In article ,
> Peter Otten <__pete...@web.de> wrote:
>
>
>> [x*x for (x,) in lst]
>>
>> [paraphrasing...] can be better written as:
>>
>> [x*x for [x] in items]
>
> I'm torn between, "Yes, the second form is distinctly easier to read"
> and,
In article ,
Peter Otten <__pete...@web.de> wrote:
> [x*x for (x,) in lst]
>
> [paraphrasing...] can be better written as:
>
> [x*x for [x] in items]
I'm torn between, "Yes, the second form is distinctly easier to read"
and, "If you think the second form is easier to read, you're admitting
yo
Tim Chase wrote:
> With the single-value tuple, I tend to find the parens make it more
> readable, so I'd go with
>
> [x*x for (x,) in lst]
Hardly ever seen in the wild, but unpacking works with [...], too:
>>> items = zip(range(5))
>>> [x*x for [x] in items]
[0, 1, 4, 9, 16]
--
https://mai
On 21/02/2014 08:27, Gary Herron wrote:
A bit of notation, because I''m not sure we are communicating well here:
A tuple is a Python data structure. It has no commas or
parentheses. The *printing* of a Python tuple uses both for it's
appearance on the output, but the tuple itself has no su
On 2014-02-21 09:29, Alister wrote:
> >>>> seriesxlist1 = ((0.0,), (0.01,), (0.02,))
> >>>> x2 = [x*x for (x,) in seriesxlist1]
> >
> > I tend to omit those parentheses and use just the comma:
> >
> >>>> x2 = [x*x for x, in seriesxlist1]
>
> I had not though of using unpacking
On Fri, 21 Feb 2014 11:13:30 +0200, Jussi Piitulainen wrote:
> Gary Herron writes:
>
>> On 02/20/2014 10:49 PM, Jaydeep Patil wrote:
>> > I am getting below tuple from excel.
>> > How should i remove extra commas in each tuple to make it easy for
>> > operations.
>> >
>> > tuples is:
>> > seriesx
Gary Herron writes:
> On 02/20/2014 10:49 PM, Jaydeep Patil wrote:
> > I am getting below tuple from excel.
> > How should i remove extra commas in each tuple to make it easy for
> > operations.
> >
> > tuples is:
> > seriesxlist1 = ((0.0), (0.01), (0.02), (0.03), (0.04), (0.05), (0.06),
> > (0.0
On 02/20/2014 10:49 PM, Jaydeep Patil wrote:
I am getting below tuple from excel.
How should i remove extra commas in each tuple to make it easy for operations.
tuples is:
seriesxlist1 = ((0.0), (0.01), (0.02), (0.03), (0.04), (0.05), (0.06), (0.07),
(0.08), (0.09), (0.1), (0.11))
please sug
On 2014-02-21, Mircescu Andrei wrote:
> vineri, 21 februarie 2014, 08:49:01 UTC+2, Jaydeep Patil a scris:
>> I am getting below tuple from excel.
>>
>> How should i remove extra commas in each tuple to make it easy for
>> operations.
>>
>>
>>
>> tuples is:
>>
>> seriesxlist1 = ((0.0), (0.01),
This is just a tuple of integers and not a tuple of tuples of integers, the
parentheses around the number is just there for the evaluation.
> On 21 févr. 2014, at 08:02 AM, Mircescu Andrei
> wrote:
>
> vineri, 21 februarie 2014, 08:49:01 UTC+2, Jaydeep Patil a scris:
>> I am getting below tu
vineri, 21 februarie 2014, 08:49:01 UTC+2, Jaydeep Patil a scris:
> I am getting below tuple from excel.
>
> How should i remove extra commas in each tuple to make it easy for operations.
>
>
>
> tuples is:
>
> seriesxlist1 = ((0.0), (0.01), (0.02), (0.03), (0.04), (0.05), (0.06),
> (0.07), (
I am getting below tuple from excel.
How should i remove extra commas in each tuple to make it easy for operations.
tuples is:
seriesxlist1 = ((0.0), (0.01), (0.02), (0.03), (0.04), (0.05), (0.06), (0.07),
(0.08), (0.09), (0.1), (0.11))
please suggest me solution.
Regards
jay
--
https://ma
14 matches
Mail list logo