Frankie,
Dictionaries do not sort in python because it's much faster to leave it
unordered and most of the time it isn't necessary.
If you really need ordered dictionaries you can use
http://pypi.python.org/pypi/ordereddict for Python <2.7. If you are using
python 2.7+ then you can import it from
On 05/08/2012 07:27 AM, Cranky Frankie wrote:
> On Mon, May 7, 2012 at 10:31 PM, bob gailer wrote:
>
>> Asking why does it not do what I want is not IMHO the best way to win
>> friends here.
> Good morning to you to, Bob.
>
> I see now that dictionaries in Python act like relational databases in
>
On Mon, May 7, 2012 at 10:31 PM, bob gailer wrote:
> Asking why does it not do what I want is not IMHO the best way to win
> friends here.
Good morning to you to, Bob.
I see now that dictionaries in Python act like relational databases in
that there is no inherent ordering. At first, when I sim
Put it simple, dictionaries do not sort. You can use the dict.keys() to get
a list of the dictionary keys, then sort them... there are lots of talks on
this, just google a bit, and you will find fancy ways to do key or value
sorting.
--
*Braga, Bruno*
www.brunobraga.net
bruno.br...@gmail.com
On
On 5/7/2012 1:16 PM, Cranky Frankie wrote:
In 3.2.2 in IDLE I have this dictionary entry:
Namath = {"first_name": "Joe", "last_name": "Namath", "phone": "212-222-",\
"email": "joe.nam...@gmail.com", "stadium": "Shea Stadium"}
when I print it:
print(Namath)
I get:
{'phone': '21
On 07/05/2012 18:16, Cranky Frankie wrote:
In 3.2.2 in IDLE I have this dictionary entry:
Namath = {"first_name": "Joe", "last_name": "Namath", "phone": "212-222-",\
"email": "joe.nam...@gmail.com", "stadium": "Shea Stadium"}
when I print it:
print(Namath)
I get:
{'phone': '21
Hi,
On 7 May 2012 18:16, Cranky Frankie wrote:
> In 3.2.2 in IDLE I have this dictionary entry:
>
> Namath = {"first_name": "Joe", "last_name": "Namath", "phone": "
> 212-222-",\
> "email": "joe.nam...@gmail.com", "stadium": "Shea Stadium"}
>
> Why is it out of order?
Python dicti
In 3.2.2 in IDLE I have this dictionary entry:
Namath = {"first_name": "Joe", "last_name": "Namath", "phone": "212-222-",\
"email": "joe.nam...@gmail.com", "stadium": "Shea Stadium"}
when I print it:
print(Namath)
I get:
{'phone': '212-222-', 'first_name': 'Joe', 'last_name':