![]() (Side-note: log transforming the data makes it easier to model.) #png_file = 'a1_5_histlog.png' #print "\n(5) HISTOGRAM OF LOG POPULATION: %s" % png_file data = np. astype ( 'int' ) #hist = data.hist(bins=60) #hist.get_figure().savefig(png_file) #plt.show() #B.5) HISTOGRAM OF LOG POPULATION: a1_5_histlog.png: Add a column, “log_pop” = log(“2011 population value”). replace ( val, ',', '' ))) #make sure all ints data = data. Choose an appropriate number of bins #png_file = 'a1_4_histpop.png' #print "\n(4) HISTOGRAM OF POPULATION: %s" % png_file import string if data. #B.4) HISTOGRAM OF POPULATION: a1_4_histpop.png: #A histogram of the field “'2011 population estimate Value'”. Model whether a county was ranked based on its population. index ))) #A.3) TOTAL RANKED COUNTIES: The total number of counties without a “1” in the field “County that was not ranked” notRankedCounties = ) if isRanked = 1 ] rankedCounties = ) if isRanked != 1 ] #print "\n(3) TOTAL RANKED COUNTIES:" #print("\t\t\t\t%d "%(len(rankedCounties))) # B. (see “NOTE” above) print " \n (2) TOTAL COUNTIES IN FILE:" print ( " \t\t\t\t %d " % ( len ( data. ![]() ![]() read_csv ( file, sep = ',', low_memory = False ) #A.1) COLUMN HEADERS: #print "\n (1) COLUMN HEADERS:" valsColumn = data = data #filter data frame to only county rows (those with countycode != 0) data = data #filter to "value" columns valsColumn = #drop the non-value columns #print valsColumn #A.2) TOTAL COUNTIES IN FILE: The total number of counties in the file. argv print "loading %s " % file data = pd. file = '2015 CHR Analytic Data.csv' if ( len ( sys. Some steps from this setup the data for our hypothesis test so they are kept in this cell.
0 Comments
Leave a Reply. |