from webplot import p
p.use_doc('uefa')
from collections import Counter
import numpy as np

from wakaridata.sportstats import SportStats

sports = SportStats()

uefa_data = sports[sports.keys()[4]][:]

dob_months = [int(dob.split('-')[1]) for dob in uefa_data['DOB']]

mCount = Counter(dob_months)

for c in mCount:
    print c, mCount[c]

months = mCount.keys()
soccer = np.array(mCount.values())

p.plot(months,soccer,width=500, height=300,title='Number of Births per Month for UEFA 2012')

#http://www.cdc.gov/nchs/data/nvsr/nvsr60/nvsr60_01_tables.pdf#I02
#birth rates per month across USA 2009
US_Total_2009 = np.array([337980,316641,347803,337272,345257,346971,368450,359554\
                          ,361922,347625,320195,340995],dtype='float64')
                
p.figure()
p.plot(months,US_Total_2009,width=500, height=300,title='Totals Births per Month 2009 (USA)')
Ejemplo n.º 2
0
from webplot import p
p.use_doc('nhl_analysis')
from collections import Counter
import numpy as np

from wakaridata.sportstats import SportStats

sports = SportStats()

nfl_data = sports[sports.keys()[2]][:]

dob_months = [int(dob.split('-')[1]) for dob in nfl_data['DOB']]

mCount = Counter(dob_months)

for c in mCount:
    print c, mCount[c]

months = mCount.keys()
nfl = np.array(mCount.values())

p.plot(months,nfl,title='Number of Births per Month for NFL')

#http://www.cdc.gov/nchs/data/nvsr/nvsr60/nvsr60_01_tables.pdf#I02
#birth rates per month across USA 2009
US_Total_2009 = np.array([337980,316641,347803,337272,345257,346971,
    368450,359554,361922,347625,320195,340995])
                
p.figure()
p.plot(months,US_Total_2009,title='Totals Births per Month 2009 (USA)')
Ejemplo n.º 3
0
from webplot import p
p.use_doc('mlb_analysis')
from collections import Counter
import numpy as np

from wakaridata.sportstats import SportStats

sports = SportStats()

mlb_data = sports[sports.keys()[0]][:]

dob_months = [int(dob.split('-')[1]) for dob in mlb_data['DOB']]

mCount = Counter(dob_months)

for c in mCount:
    print c, mCount[c]

months = mCount.keys()
mlb = np.array(mCount.values())

p.plot(months,mlb,title='Number of Births per Month for MLB')

#http://www.cdc.gov/nchs/data/nvsr/nvsr60/nvsr60_01_tables.pdf#I02
#birth rates per month across USA 2009
US_Total_2009 = np.array([337980,316641,347803,337272,345257,346971,368450,359554 \
                          ,361922,347625,320195,340995],dtype='float64')
                
p.figure()
p.plot(months,US_Total_2009,title='Totals Births per Month 2009 (USA)')
Ejemplo n.º 4
0
from webplot import p
from collections import Counter
import numpy as np

from wakaridata.sportstats import SportStats

sports = SportStats()

nhl_data = sports[sports.keys()[1]][:]

dob_months = [int(dob.split('-')[1]) for dob in nhl_data['DOB']]

mCount = Counter(dob_months)

print 'All Hockey Players Birth Dates By Month'
for c in mCount:
    print c, mCount[c]

months = mCount.keys()
NHL = np.array(mCount.values())

#plotting NHL Births per Month
p.plot(months,NHL,title='Number of Births per Month for NHL<br/>Blue: Total NHL, Red: NHL (Canada)')

canada = nhl_data[nhl_data['Nationality']=='Canada']

CanadaMonths = [int(dob.split('-')[1]) for dob in canada['DOB']]
CanadaCount = Counter(CanadaMonths)

canadaNHL = np.array(CanadaCount.values())
Ejemplo n.º 5
0
from webplot import p
p.use_doc('nba_analysis')
from collections import Counter
import numpy as np

from wakaridata.sportstats import SportStats

sports = SportStats()

nba_data = sports[sports.keys()[3]][:]

months = [int(dob.split('-')[1]) for dob in nba_data['DOB']]

mCount = Counter(months)

for c in mCount:
    print c, mCount[c]

months = mCount.keys()
nba = np.array(mCount.values())

p.plot(months,nba,title='Number of Births per Month for nba')

#http://www.cdc.gov/nchs/data/nvsr/nvsr60/nvsr60_01_tables.pdf#I02
#birth rates per month across USA 2009
US_Total_2009 = np.array([337980,316641,347803,337272,345257,346971,368450,359554\
                ,361922,347625,320195,340995],dtype='float64')
                
p.figure()
p.plot(months,US_Total_2009,title='Totals Births per Month 2009 (USA)')