################## #Crosstab all devs geographical regions against development area regions=de.crosstab(de16, de16_meta, 'RegionCode8','CR2a', 'WghtUniversal_Core') regions.to_clipboard() #Crosstab professionals only in geographical regions against development area de16['Prof'] = (de16[['CR2b_2_1']].any(axis=1)).astype(float).replace(0,2) regions=de.crosstab(de16[de16.Prof==1], de16_meta, 'RegionCode8','CR2a', 'WghtUniversal_Core') regions.to_clipboard() mob_devs = (de16.CR2a_2==1) filtered = de.dist(de16[mob_devs], de16_meta, 'CR_DEV4', 'WghtUniversal_Core') filtered_pc = de.calc_pct(filtered) filtered_pc.to_clipboard() cr_dev4 = de.dist(de16, de16_meta, 'CR_DEV4', 'WghtUniversal_Core') cr_dev4_pc = de.calc_pct(cr_dev4) cr_dev4_pc.to_clipboard() #Look at number of mobile devs cr2 = de.dist(de16, de16_meta, 'CR2a', 'WghtUniversal_Core') cr2.to_clipboard() cr2_pc = de.calc_pct(cr2) cr2_pc.to_clipboard() #Look at areas of development (CR2a) #Just women devs (filter) dev_female = de.dist(de16[de16['CR_DEV3']==1],de16_meta,'CR2a','WghtUniversal_Core')
# Read DE15 data de15 = de.read_sparta_survey(6) de15_meta = de.meta(6) # Read DE14 data de14 = de.read_sparta_survey(5) de14_meta = de.meta(5) # Read DE13 data de13 = de.read_sparta_survey(4) de13_meta = de.meta(4) #GAM1: What types of platform do you develop games for? gam1 = de.dist(de15, de15_meta, 'GAM1', 'WghtUniversal_Game') gam1pc = de.calc_pct(gam1) gam1pc.to_clipboard() #GAM1 gam1_14 = de.dist(de14, de14_meta, 'GAM1', 'WghtUniversal_Game') gam1_14pc = de.calc_pct(gam1_14) gam1_14pc.to_clipboard() #GAM1 gam1_13 = de.dist(de13, de13_meta, 'GAM1', 'WghtUniversal_Game') gam1_13pc = de.calc_pct(gam1_13) gam1_13pc.to_clipboard() #GAM2: Which consoles do you target with your games? gam2 = de.dist(de15, de15_meta, 'GAM2', 'WghtUniversal_Game') gam2pc = de.calc_pct(gam2)
################## #Look at age levels (CR_DEV2) # whole dev population cr_dev2 = de.dist(de16, de16_meta, 'CR_DEV2', 'WghtUniversal_Core') cr_dev2_pc = de.calc_pct(cr_dev2) cr_dev2_pc.to_clipboard() #Experience (CR6) #Just women devs (filter) dev_female = de.dist(de16[de16['CR_DEV3']==1],de16_meta,'CR6','WghtUniversal_Core') dev_female.to_clipboard() #Just male devs (filter) dev_male = de.dist(de16[de16['CR_DEV3']==3],de16_meta,'CR6','WghtUniversal_Core') dev_male.to_clipboard() #crosstab CR_DEV2 (age) with CR5 (job description/role) -- women crosstab=de.crosstab(de16[de16['CR_DEV3']==1], de16_meta, 'CR5', 'CR_DEV2', 'WghtUniversal_Core') crosstab.to_clipboard()
# weights Sparta_Core = 'WghtUniversal_Core' ################## # Read de14 data de14 = de.read_sparta_survey(5) de14_meta = de.meta(5) ################## #Non professionals de14['nonprof'] = (de14[['CR2_2_2', 'CR2_2_3']].any(axis=1)).astype(float).replace(0, 2) npros_only = de.dist(de14[de14.nonprof == 1], de14_meta, 'MOB4', 'WghtUniversal_Mob') npros_onlypc = de.calc_pct(npros_only) npros_onlypc.to_clipboard() # Mobile professionals only de14['Prof'] = (de14[['CR2_2_1']].any(axis=1)).astype(float).replace(0, 2) pros_only = de.dist(de14[de14.Prof == 1], de14_meta, 'MOB4', 'WghtUniversal_Core') pros_onlypc = de.calc_pct(pros_only) pros_onlypc.to_clipboard() #MOB3: What programming languages? mob3 = de.dist(de14, de14_meta, 'MOB3', 'WghtUniversal_Mob') mob3pc = de.calc_pct(mob3) mob3pc.to_clipboard() # Mobile professionals only
# weights Sparta_Core = 'WghtUniversal_Core' ################## # Read de15 data de15 = de.read_sparta_survey(6) de15_meta = de.meta(6) ################## #Non professionals de15['nonprof'] = (de15[['CR2_2_2', 'CR2_2_3']].any(axis=1)).astype(float).replace(0, 2) npros_only = de.dist(de15[de15.nonprof == 1], de15_meta, 'MOB2', 'WghtUniversal_Mob') npros_onlypc = de.calc_pct(npros_only) npros_onlypc.to_clipboard() # Mobile professionals only de15['Prof'] = (de15[['CR2_2_1']].any(axis=1)).astype(float).replace(0, 2) pros_only = de.dist(de15[de15.Prof == 1], de15_meta, 'MOB_POP2', 'WghtUniversal_Core') pros_onlypc = de.calc_pct(pros_only) pros_onlypc.to_clipboard() #Crosstab all devs geographical regions against development area regions = de.crosstab(de15, de15_meta, 'RegionCode8', 'CR2', 'WghtUniversal_Core') regions.to_clipboard() #Look at number of mobile devs
# AMD de16['AMDDevs'] = de16[['CR_DPB1_3']].any(axis=1).astype(float).replace(0,np.nan) amddevs=de16.AMDDevs==1 # NVIDIA de16['NVIDIADevs'] = de16[['CR_DPB1_15']].any(axis=1).astype(float).replace(0,np.nan) nvdevs=de16.NVIDIADevs==1 # game devs de16['GAMES'] = de16[['CR2b_8_1', 'CR2b_8_2', 'CR2b_8_3']].any(axis=1).astype(float).replace(0,np.nan) game_dev=de16.GAMES==1 # GAM5 - Language gam5 = de.dist(de16[inteldevs],de16_meta,'GAM5','WghtUniversal_Game') gam5_pc=de.calc_pct(gam5) gam5_pc.to_clipboard() gam5 = de.dist(de16[ninteldevs],de16_meta,'GAM5','WghtUniversal_Game') gam5_pc=de.calc_pct(gam5) gam5_pc.to_clipboard() gam5 = de.dist(de16[amddevs],de16_meta,'GAM5','WghtUniversal_Game') gam5_pc=de.calc_pct(gam5) gam5_pc.to_clipboard() gam5 = de.dist(de16[nvdevs],de16_meta,'GAM5','WghtUniversal_Game') gam5_pc=de.calc_pct(gam5) gam5_pc.to_clipboard() gam5 = de.dist(de16[ndevs],de16_meta,'GAM5','WghtUniversal_Game')
import deutils as de import numpy as np # weights Sparta_Core = 'WghtUniversal_Core' ################## # Read de13 data de13 = de.read_sparta_survey(4) de13_meta = de.meta(4) ################## #MOB3: What programming languages? mob3 = de.dist(de13, de13_meta, 'MOB3', 'WghtUniversal_Mob') mob3pc = de.calc_pct(mob3) mob3pc.to_clipboard() # Mobile professionals only de13['Prof'] = (de13[['CR2_2_1']].any(axis=1)).astype(float).replace(0,2) pros_only = de.dist(de13[de13.Prof==1], de13_meta, 'MOB3', 'WghtUniversal_Core') pros_onlypc = de.calc_pct(pros_only) pros_onlypc.to_clipboard() #Filter mobile devs programming language choice by those that use cross platform dev tools de13['xplat'] = (de13[['MOB_PA_1']].any(axis=1)).astype(float).replace(0,2) mob3_xplat = de.dist(de13[de13.xplat==1], de13_meta, 'MOB3', 'WghtUniversal_Mob') mob3_xplatpc = de.calc_pct(mob3_xplat) mob3_xplatpc.to_clipboard()
Granny-Clanger:~ stichbury$ /Users/stichbury/anaconda/envs/py3/bin/spyder ; exit; @author: stichbury """ # -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ # Imports import pandas as pd import deutils as de import numpy as np # weights Sparta_Core = 'WghtUniversal_Core' ################## # Read de14 data de12 = de.read_sparta_survey(3) de12_meta = de.meta(3) ################## # CR6: experience levels over survey cr6 = de.dist(de12, de12_meta, 'CR6', 'WghtUniversal_Core') cr6_pc = de.calc_pct(cr6, pct_type='row') cr6_pc.to_clipboard()