Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
| Download
Project: Default
Views: 1486
import scipy.stats f = open('beauty.csv', 'r') head = f.readline() data = f.readlines() f.close() wage = [] exper = [] educ = [] for row in data : p = row.split(';') wage.append(float(p[0])) exper.append(float(p[1])) educ.append(float(p[8])) wage, exper, educ = vector(wage), vector(exper), vector(educ) show(wage[:10], exper[:10], educ[:10])
(5.73,4.28,7.96,11.57,11.42,3.91,8.76,7.69,5.0,3.89)\displaystyle \left(5.73,\,4.28,\,7.96,\,11.57,\,11.42,\,3.91,\,8.76,\,7.69,\,5.0,\,3.89\right) (30.0,28.0,35.0,38.0,27.0,20.0,12.0,5.0,5.0,12.0)\displaystyle \left(30.0,\,28.0,\,35.0,\,38.0,\,27.0,\,20.0,\,12.0,\,5.0,\,5.0,\,12.0\right) (14.0,12.0,10.0,16.0,16.0,12.0,16.0,16.0,16.0,12.0)\displaystyle \left(14.0,\,12.0,\,10.0,\,16.0,\,16.0,\,12.0,\,16.0,\,16.0,\,16.0,\,12.0\right)
scipy.stats.normaltest(wage) scipy.stats.normaltest(exper) scipy.stats.normaltest(educ)
NormaltestResult(statistic=1320.5280096765098, pvalue=1.7823217192197183e-287) NormaltestResult(statistic=140.58947002276543, pvalue=2.9606323326980526e-31) NormaltestResult(statistic=49.33790613234838, pvalue=1.9337922216783728e-11)
list_plot(wage, axes_labels=['', 'wage']) list_plot(exper, axes_labels=['', 'exper']) list_plot(educ, axes_labels=['', 'educ'])
new_wage = list(wage) new_wage.remove(max(wage)) new_wage = map(lambda x: ln(x), new_wage) scipy.stats.normaltest(new_wage)
NormaltestResult(statistic=1.9852782645576972, pvalue=0.3705973438644804)
new_exper = map(lambda x: ln(x), list(exper)) scipy.stats.normaltest(new_exper)
NormaltestResult(statistic=nan, pvalue=nan)
new_educ = map(lambda x: ln(x), list(educ)) scipy.stats.normaltest(new_educ)
NormaltestResult(statistic=414.67394638497854, pvalue=9.0094161560384521e-91)