how to list all the values in a ndarray without repeat (like filter in excel)
Dear all, if I have a ndarray like array([1,2,3,2,3,1,1,1,2,2,....,2,2,3]) containing some values that are flag for data quality. how can list all the values in this array, like doing a descriptive statistics. I guess I should use Scipy statistics ? Thanks for any ideas. Chao -- *********************************************************************************** Chao YUE Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) UMR 1572 CEA-CNRS-UVSQ Batiment 712 - Pe 119 91191 GIF Sur YVETTE Cedex Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 ************************************************************************************
On Thu, Oct 13, 2011 at 9:14 AM, Chao YUE
Dear all,
if I have a ndarray like array([1,2,3,2,3,1,1,1,2,2,....,2,2,3]) containing some values that are flag for data quality. how can list all the values in this array, like doing a descriptive statistics. I guess I should use Scipy statistics ? Thanks for any ideas.
Not sure what you are asking for np.unique to get unique values selecting by mask: mask = (myarr == 3), arr[mask] or statistics of another variable by groups/flags: np.bincount(arr, weights=myvar) Josef
Chao
-- *********************************************************************************** Chao YUE Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) UMR 1572 CEA-CNRS-UVSQ Batiment 712 - Pe 119 91191 GIF Sur YVETTE Cedex Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 ************************************************************************************
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
On Thursday, October 13, 2011, Chao YUE
Dear all,
if I have a ndarray like array([1,2,3,2,3,1,1,1,2,2,....,2,2,3]) containing some values that are flag for data quality. how can list all the values in this array, like doing a descriptive statistics. I guess I should use Scipy statistics ? Thanks for any ideas.
Chao
Would np.unique() do the job? Ben Root
Yes, np.unique() is exactly what I want. thanks.
chao
2011/10/13 Benjamin Root
On Thursday, October 13, 2011, Chao YUE
wrote: Dear all,
if I have a ndarray like array([1,2,3,2,3,1,1,1,2,2,....,2,2,3]) containing some values that are flag for data quality. how can list all the values in this array, like doing a descriptive statistics. I guess I should use Scipy statistics ? Thanks for any ideas.
Chao
Would np.unique() do the job?
Ben Root
_______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion
-- *********************************************************************************** Chao YUE Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) UMR 1572 CEA-CNRS-UVSQ Batiment 712 - Pe 119 91191 GIF Sur YVETTE Cedex Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 ************************************************************************************
participants (3)
-
Benjamin Root
-
Chao YUE
-
josef.pktd@gmail.com