Any of those help The first thing this function does is make sure that the input is an array. Notice what happens when I try several variations on a list

code :

```
In [1164]: np.array([1,2,3])
Out[1164]: array([1, 2, 3]) # integer array
In [1165]: np.array([1,2,3,np.nan])
Out[1165]: array([ 1., 2., 3., nan]) # float array
In [1166]: np.array([1,2,3,np.nan,'str'])
Out[1166]:
array(['1', '2', '3', 'nan', 'str'],
dtype='<U32')
```

```
In [1168]: np.isnan(np.array([1,2,3,np.nan]))
Out[1168]: array([False, False, False, True], dtype=bool)
In [1169]: np.isnan(np.array([1,2,3,np.nan,'str']))
...
TypeError: ufunc 'isnan' not supported for the input types,...
```

```
In [1174]: [i for i in [1,2,3,np.nan,'str'] if not isinstance(i,str)]
Out[1174]: [1, 2, 3, nan]
In [1176]: nlist=[i for i in [1,2,3,np.nan,'str'] if not isinstance(i,str)]
In [1177]: np.array(nlist)
Out[1177]: array([ 1., 2., 3., nan])
In [1178]: np.isnan(np.array(nlist))
Out[1178]: array([False, False, False, True], dtype=bool)
In [1180]: np.nanpercentile(nlist,.2)
Out[1180]: 1.004
```

```
In [1187]: np.nanpercentile([],.2)
/usr/lib/python3/dist-packages/numpy/lib/nanfunctions.py:675: RuntimeWarning: Mean of empty slice
warnings.warn("Mean of empty slice", RuntimeWarning)
Out[1187]: nan
```