Recent Posts
None | 11 sec ago
None | 14 sec ago
None | 43 sec ago
None | 47 sec ago
C | 1 min ago
C | 1 min ago
None | 1 min ago
Python | 1 min ago
None | 1 min ago
None | 1 min ago
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
Learn a little bit about the new Pastebin.com on our help page. hide message
By Anonymous on the 9th of Feb 2010 11:12:49 PM Download | Raw | Embed | Report
  1. def sortData(fileName):                        
  2.         rawData = open(fileName+'.txt')
  3.         a = []                                 
  4.         b = []                                 
  5.         for k in range(20):
  6.                 b.append(0)
  7.         for m in range(5):
  8.                 a.append(b)
  9.        
  10.         #for l in rawData:
  11.         #       x = l.split()
  12.         #       #print(z)
  13.         #       for i in x:
  14.         #               a[1][int(i)] = a[1][int(i)]+1                  
  15.         #       #print(a)
  16.         #       print a
  17.         #z = z+1
  18.                
  19.         for l in rawData:
  20.                 x = l.split()
  21.                 for i in x:
  22.                         b[int(i)] = b[int(i)] + 1
  23.                 for j in range(20):
  24.                         a[0][j] = b[j]
  25.                 z = (z+1)
  26.         return a                               
  27.  
  28. print sortData("U2Fans")
Submit a correction or amendment below. [ previous version ] | [ difference ] | Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: