This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2010年02月12日 02:13 by throwaway, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Messages (6) | |||
|---|---|---|---|
| msg99249 - (view) | Author: Alex Coventry (throwaway) | Date: 2010年02月12日 02:13 | |
I feel like I must be on crack, here. I apologize if so. English version: sorting this long list leaves in place element 580395, which is less than element 0. Restricting to a list of just those two elements, sorting does what I'd expect.
met% python2.6 # This problem also happens with 2.5
Python 2.6b1+ (trunk:64955, Jul 14 2008, 17:23:39)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os, cPickle
>>> t = cPickle.load(os.popen('gunzip -c list.pickle.gz')) # Load the pickle in. It's a list of pairs of numbers
>>> t.sort() # Sort the pickle
>>> t[580395] < t[0] # It's not in order!
True
>>> u = [t[0], t[580395]] # Make a list of just the two compared elements and sort
>>> u.sort()
>>> u == [t[580395], t[0]] # Now it's in order!
True
>>>
|
|||
| msg99250 - (view) | Author: Ezio Melotti (ezio.melotti) * (Python committer) | Date: 2010年02月12日 02:22 | |
Could you provide the list in another format (e.g. in a plain .py script or as a .txt file)? |
|||
| msg99252 - (view) | Author: Alex Coventry (throwaway) | Date: 2010年02月12日 02:27 | |
No. It's 10M, gzipped. It's constructed from genome-wide association data, which is also huge, intrinsically complex, and protected by rules regarding research on humans. If the bug tracker won't take it do I have any other options? |
|||
| msg99253 - (view) | Author: Alex Coventry (throwaway) | Date: 2010年02月12日 02:28 | |
Oh, I guess I could make it a gzipped text file. Hang on. |
|||
| msg99254 - (view) | Author: Thomas Wouters (twouters) * (Python committer) | Date: 2010年02月12日 02:29 | |
You have a nan in your list of tuples, which screws up the sorting. After the first sort, elements 580395-7 are: (0.99257340581672904, 551095), (nan, 551371), (6.6494600485570754e-14, 551526), |
|||
| msg99255 - (view) | Author: Alex Coventry (throwaway) | Date: 2010年02月12日 02:30 | |
Ah, I guess I *was* on crack. Thanks for the explanation. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:57 | admin | set | github: 52163 |
| 2010年02月12日 02:30:52 | throwaway | set | messages: + msg99255 |
| 2010年02月12日 02:30:21 | ezio.melotti | set | stage: test needed -> resolved |
| 2010年02月12日 02:29:18 | twouters | set | status: open -> closed nosy: + twouters messages: + msg99254 resolution: not a bug |
| 2010年02月12日 02:28:32 | throwaway | set | messages: + msg99253 |
| 2010年02月12日 02:27:45 | throwaway | set | messages: + msg99252 |
| 2010年02月12日 02:23:11 | ezio.melotti | set | files: - list.pickle.gz |
| 2010年02月12日 02:22:53 | ezio.melotti | set | priority: normal versions: - Python 2.5 nosy: + ezio.melotti messages: + msg99250 stage: test needed |
| 2010年02月12日 02:13:59 | throwaway | create | |