I want to be able to run numpy commands on a list that maintains NaN values. Basically, I want to do linear regression on two list variables. One variable contains NaN's and so I can't do linear regression on it. But, if I delete the NaN value then the size of my list does not match the size of the non-NaN containing list. For example,
x = [1,2,3,4,5,NaN]
If I delete the NaN value then the size of x
becomes 5
y = [1,2,3,4,5,6]
The size of y
is 6
(x,y) = (1,1), (2,2), (3,3), (4,4), (5,5), (NaN, 6)
I want my linear regression to skip the data point (NaN, 6)
How can I do this?