books = {}
books['auth1'] = {}
books['auth2'] = {}
books['auth1']['humor'] = 20
books['auth1']['action'] = 30
books['auth2']['comedy'] = 20
from pandas import *
df = DataFrame(books).T.fillna(0)
converting a 2d dictionary to a numpy matrix