haganbt / PYLON-exporter

Utility for exporting data from a PYLON index
4 stars 2 forks source link

Support normalization comparrisons #28

Closed haganbt closed 8 years ago

haganbt commented 9 years ago
running=list()
keys=list()
for cat in moviesdemogs.index.levels[0]:
    keys.append(cat)
    demog=moviesdemogs[['unique_authors']].ix[cat].join(usag[['unique_authors']],rsuffix='_baseline')
    totals=demog.sum()
    demog['exp_baseline']=demog['unique_authors_baseline']*totals['unique_authors']/totals['unique_authors_baseline']
    demog['index']=demog['unique_authors']/demog['exp_baseline']
    running.append(demog)
normalised=pd.concat(running,keys=keys,names=['category'])
#normalised.to_csv('/Users/tim/x.tab',sep='\t')
normalised
haganbt commented 9 years ago

image

haganbt commented 9 years ago

image

haganbt commented 9 years ago
  1. Derive the normalization request based on type:
    • single target - with filter - no filter will return an index of 0.
    • native nested
    • custom nested
    • merged - not supported?
  2. Normalization request must always be the last
haganbt commented 9 years ago

1) Run duplicate query against external index

haganbt commented 8 years ago

Complete in https://github.com/haganbt/pepp