# Some of the p-values are NaN - logistic regression

I am trying to do logisitc regression, but have this issue - some of the p values are NaN

model = sm.Logit(y2,X2.astype(float))
result = model.fit()
result.summary()


Any ideas what to do?

• I've never used this package but my guess would be that there's a problem with these 4 variables about the time of day in the data. The main problem is not that the p-values are NaN, this is probably just a consequence of the first error "maximum likelihood failed to converge". Check the format of your data, in particular the type of these variables: they should be numerical I assume. It looks as if it doesn't find any value for these variables. – Erwan Jan 20 at 23:40
• I think, this might be useful - stackoverflow.com/a/55556806/8675216 – Akash Dubey Jan 22 at 21:03
• They are numerical, but it can be that there are many 0's, so the article that @AkashDubey recommend could be good, I will try some other methods for logit. – Sim_Demo Jan 23 at 13:34