SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 313 Weeks Ago, 5 Days Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 20 Nov 2017 My Price 10.00

File "C:Python27BryanSohn.py", line 5, in

I am running Python 2.7 in command prompt.

I am keep getting an error message.

 

C:Python27>BryanSohn.py

Traceback (most recent call last):

 File "C:Python27BryanSohn.py", line 5, in <module>

  from builtin import sorted

ImportError: No module named builtin

import csv

import copy

import operator

from token import EQUAL

from _builtin_ import sorted

 

 

reader = csv.reader(open('C:\\Python27\\Largest_Cities_CSV.csv'), delimiter=",")

 

u = 'State  -     Place'

x = 'Year'

y = 'Population'

z = 'Sohn - Rank'

rows_so_far = 0

c = 0

 

pool = []

 

pool.append ([])

 

for row in reader:

      if rows_so_far ==0:

            rows_so_far+= 1

            header=row

     

      for j in range(0, 4) :

            if j==0:

                  pool.append([])

                  pool[0].append(u)

            if j==1:

                  pool[0].append(x)

            if j==2:

                  pool[0].append(y)

            if j==3:

                  pool[0].append(z)

      else:

     

            for i in reange(len(row)-2):

                  a = len(pool)

                  if not row ==[]:

                        if i ==0 or i>=1:

                              item = copy.deepcopy(row)

                              r      = copy.deepcopy(row)

                              for j in range (0,      4) :

                                    if item[i+2] is not '':

                                          if j==0:

                                                r[0] = item[j+1]+'      -     '+item[j]

                                                pool.append([])

                                                pool[a-1].append(r[0])

                                          if j==1:

                                                pool [a-1].append(int(header[i+2]))

                                          if j==2:

                                                if item[i+2] =='':

                                                      pool[a-1].append(int(0))

                                                else:

                                                      pool[a-1].append(int(item[i+2]))

                                          if j==3:

                                                pool[a-1].append(int(0))

      rows_so_far += 1

 

a = len(pool)

list = pool[1:a-1]

 

list.sort(key=lambda b: (b[1], b[2]), reverse=True)

 

list1=[]

list1.append([])

list1[0]=pool[0]

list1[1:a-1] = list[0:a-2]

 

mycsv = csv.writer(open('C:\\Python27\\ranadeep.csv', 'wb'))

for row in list1:

      e = list1.index(row)

      if row[1]<> c and e <> 0:

            v = 1

            c + row[1]

            row[3] = values

      else:

            if row[1] == c and e <> 0 :

                  v+=1

                  row[3] = values

      mycsv.writerow(row)

                                         

           

 

 

Could anyone help me with this>

Answers

(5)
Status NEW Posted 20 Nov 2017 02:11 PM My Price 10.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)