al Message-
From: Python-list
[mailto:python-list-bounces+david.raymond=tomtom@python.org] On Behalf Of
har...@moonshots.co.in
Sent: Thursday, August 30, 2018 4:31 AM
To: python-list@python.org
Subject: Re: How to sort over dictionaries
> > sort = sorted(results, key=lambda res:ite
> > sort = sorted(results, key=lambda res:itemgetter('date'))
> > print(sort)
> >
> >
> > I have tried the above code peter but it was showing error like
> > TypeError: '<' not supported between instances of 'operator.itemgetter'
> > and 'operator.itemgetter'
>
> lambda res: itemgetter('
har...@moonshots.co.in wrote:
> sort = sorted(results, key=lambda res:itemgetter('date'))
> print(sort)
>
>
> I have tried the above code peter but it was showing error like
> TypeError: '<' not supported between instances of 'operator.itemgetter'
> and 'operator.itemgetter'
lambda res: it
>
> > On Wednesday, August 29, 2018 at 11:20:26 AM UTC+5:30, John Ladasky wrote:
> >> The top-level object you are showing is a list [], not a dictionary {}.
> >> It has dictionaries inside of it though. Do you want to sort the list?
> >>
> >> Python's sorted() function returns a sorted copy of
m: Python-list
[mailto:python-list-bounces+david.raymond=tomtom@python.org] On Behalf Of
har...@moonshots.co.in
Sent: Tuesday, August 28, 2018 11:56 PM
To: python-list@python.org
Subject: How to sort over dictionaries
[,
https://getbootstrap.com/', 'author': 'Hari'
[,
https://getbootstrap.com/', 'author': 'Hari', 'date': '15-08-2018 15:15',
'headline': 'latest news'}>, , https://www.deps.co/blog/google-cloud-platform-good-bad-ugly/', 'author':
'Harish', 'headline': 'Google Cloud Platform – The Good, Bad, and Ugly',
'date': '16-08-2018 08:15'}>, , ,
http:
har...@moonshots.co.in wrote:
> On Wednesday, August 29, 2018 at 11:20:26 AM UTC+5:30, John Ladasky wrote:
>> The top-level object you are showing is a list [], not a dictionary {}.
>> It has dictionaries inside of it though. Do you want to sort the list?
>>
>> Python's sorted() function return
On Wednesday, August 29, 2018 at 11:20:26 AM UTC+5:30, John Ladasky wrote:
> The top-level object you are showing is a list [], not a dictionary {}. It
> has dictionaries inside of it though. Do you want to sort the list?
>
> Python's sorted() function returns a sorted copy of a sequence. Sort
The top-level object you are showing is a list [], not a dictionary {}. It has
dictionaries inside of it though. Do you want to sort the list?
Python's sorted() function returns a sorted copy of a sequence. Sorted() has
an optional argument called "key". Key accepts a second function which c