How to remove null values from an array using NumPy?

Hey, I bumped into a problem. I was trying to calculate the sum of the total values of a NumPy array using looping but it threw me an error, saying it contains NaN values, I printed my array and it looked like this:

[1,2,3,NaN,4,NaN,5,6,7,NaN]

I want to make it look like this:

[1,2,3,4,5,6,7]

Can anyone help me in this?