Offset in Poisson GLM with log link function where I have values equal to zero I am trying to build a GLM model (poisson family) using python statsmodels package on train data. The data I have contains categorical values as exogenous variables and numerical values for my target (endegenous variable). I did standardization for numeric values and one-hot-encoding on categorical values (drop the first level). When I fit the data into the model, I got the following exceptions :
ValueError: NaN, inf or invalid value detected in endog, 
estimation infeasible.  

The error comes when creating this model :
poisson_model = sm.GLM(endog=y_train, exog=X_train_std, 
   family=sm.families.Poisson(),
   offset = np.log(X_train_std.EXPOSITION))

The problem comes from np.log(X_train_std.EXPOSITION) since I can not apply log function on zero values. But I don't know how to correct the error. I need to take into consideration the offset and when changing its link function to identy I get EXPOSITION in the GLM output.
Any help please ? How to deal with offset that takes 0 values with a log link function ?

Standardization means that you subtract the mean $\bar y$ and then divide by the standard deviation $s_y$.
$$
z_i = \dfrac{y_i - \bar y}{s_y}
$$
By doing this transformation (unless all $y_i$ are equal, which not an interesting scenario), you create $z_i$ values less than zero, which are out of bounds in Poisson regression. This is what the error message is telling you.
(You also create $z_i$ values that are not even integers! Again, such values are out of bounds in Poisson regression.)
