sparse_scipy_optim
import pandas as pd
import scipy.optimize as sc
import scipy.sparse as sp
data = np.random.poisson(100, (10000,1))
data = sp.csr_matrix(data)
def poiss_loglike(x, data, a):
print x
return -np.sum(data*np.log(x)-x)*a
params = sc.fmin(poiss_loglike, 0, args=(data ,1))
print params