On Wed, Dec 28, 2016 at 3:43 PM, Ian Kelly wrote:
> On Wed, Dec 28, 2016 at 2:14 PM, Larry Martell
> wrote:
>>
>> I have a list containing a list of strings that I want to sort
>> numerically by one of the fields. I am doing this:
>>
>> sorted(rows, key=float(itemgetter(sortby)))
>
> I'm guessin
On Wed, Dec 28, 2016 at 2:43 PM, Ian Kelly wrote:
> On Wed, Dec 28, 2016 at 2:14 PM, Larry Martell
> wrote:
>>
>> I have a list containing a list of strings that I want to sort
>> numerically by one of the fields. I am doing this:
>>
>> sorted(rows, key=float(itemgetter(sortby)))
>
> I'm guessin
On Wed, Dec 28, 2016 at 2:14 PM, Larry Martell wrote:
>
> I have a list containing a list of strings that I want to sort
> numerically by one of the fields. I am doing this:
>
> sorted(rows, key=float(itemgetter(sortby)))
I'm guessing that you left out a lambda here since the key argument
takes a
Larry Martell wrote:
> I have a list containing a list of strings that I want to sort
> numerically by one of the fields. I am doing this:
>
> sorted(rows, key=float(itemgetter(sortby)))
>
> Which works fine as long as all the sort keys convert to a float.
No, that cannot work; unless you have
I have a list containing a list of strings that I want to sort
numerically by one of the fields. I am doing this:
sorted(rows, key=float(itemgetter(sortby)))
Which works fine as long as all the sort keys convert to a float.
Problem is that some are blank or None and those throw an exception.
How