0

I am trying to remove the nan portion of the numpy array how would I be able to do that?

Array=np.array([           nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan            nan            nan
            nan            nan 29347.81531381 29592.12284519
 29836.6358159  30081.15527197 30325.68104603 30570.2132636
 30814.75192469 31059.29702929 31304.22062762 31549.15217573
 31794.09       32038.94355649 32283.7965272  32528.64891213
 32773.5007113  33018.35192469 33263.2025523  33508.05259414
 33752.90205021 33997.89125523 34242.88041841 34487.86953975]) 

Expected Output:

Array=np.array([29347.81531381 29592.12284519
 29836.6358159  30081.15527197 30325.68104603 30570.2132636
 30814.75192469 31059.29702929 31304.22062762 31549.15217573
 31794.09       32038.94355649 32283.7965272  32528.64891213
 32773.5007113  33018.35192469 33263.2025523  33508.05259414
 33752.90205021 33997.89125523 34242.88041841 34487.86953975])
ege Selcuk
  • 227
  • 2
  • 9
  • 2
    Does this answer your question? [Removing nan values from an array](https://stackoverflow.com/questions/11620914/removing-nan-values-from-an-array) – duckboycool Apr 07 '21 at 05:20

1 Answers1

1

something like this:

Array = Array[~np.isnan(Array)]
Aors
  • 89
  • 1
  • 4