Re: naN values

2020-05-04 Thread Peter Otten
J Conrado wrote: > I have a 2d array and I would how can I replace NaN values for example > with - value or other value. >>> a array([[ nan, 1., 2., 3.], [ 4., 5., 6., 7.], [ 8., 9., 10., nan]]) >>> a[numpy.isnan(a)] = 42 >>>

naN values

2020-05-04 Thread J Conrado
Hi, I have a 2d array and I would  how can I replace NaN values for example with - value or other value. Thank, Conrado -- https://mail.python.org/mailman/listinfo/python-list

chi square test in sklearn printing NAN values for most of the columns

2020-04-27 Thread Rahul Gupta
Hi i am trying to use chi-square Test to select most important columns among 5501 columns. But for most of the columns i am getting NAN value as a Chi test value import pandas as pd from sklearn.preprocessing import LabelEncoder from sklearn.feature_selection import chi2 cols =[] cols.append(int