Xem thảo luận Cải thiện bài viết Lưu bài viết Xem thảo luận Cải thiện bài viết Lưu bài viết
Đọc Compute the qth quantile of the given data [array elements] along the specified axis. Quantile plays a very important role in Statistics when one deals with the Normal Distribution.
Bàn luận arr : [array_like]input array. q : quantile value. axis : [int or tuples of int]axis along which we want to calculate the quantile value. Otherwise, it will consider arr to be flattened[works on all the axis]. axis = 0 means along the column and axis = 1 means working along the row. out : [ndarray, optional]Different array in which we want to place the result. The array must have same dimensions as expected output. Results : qth quantile of the array [a scalar value if axis is none] or array with quantile values along specified axis.
numpy.quantile [mảng, q, trục = không]: tính toán lượng tử qth của dữ liệu đã cho [các phần tử mảng] dọc theo trục được chỉ định. Quantile đóng một vai trò rất quan trọng trong thống kê khi một người đề cập đến phân phối bình thường. Trong hình được đưa ra ở trên, Q2 là trung bình của dữ liệu được phân phối bình thường. Câu 3 - Q2 đại diện cho phạm vi liên vùng của bộ dữ liệu đã cho.
Python3
Tham số: mảng: [mảng_like] mảng đầu vào. Q: Giá trị lượng tử. Trục: [int hoặc bộ dữ liệu của int] trục dọc theo đó chúng tôi muốn tính giá trị lượng tử. Nếu không, nó sẽ coi ARR là bị san phẳng [hoạt động trên tất cả các trục]. Trục = 0 có nghĩa là dọc theo cột và trục = 1 có nghĩa là làm việc dọc theo hàng. OUT: [Ndarray, Tùy chọn] Mảng khác nhau trong đó chúng tôi muốn đặt kết quả. Mảng phải có cùng kích thước như đầu ra dự kiến. Kết quả: Quantile QTH của mảng [giá trị vô hướng nếu trục không phải là không] hoặc mảng có giá trị lượng tử dọc theo trục được chỉ định.
Mã số 1: & NBSP;
arr : [[14, 17, 12, 33, 44], [15, 6, 27, 8, 19], [23, 2, 54, 1, 4]] 50th quantile of arr, axis = None : 15.0 0th quantile of arr, axis = None : 1] 50th quantile of arr, axis = 0 : [14.5 4. 19.5 4.5 11.5] 0th quantile of arr, axis = 0 : [14 2 12 1 4] 50th quantile of arr, axis = 1 : [17. 15. 4.] 0th quantile of arr, axis = 1 : [12 6 1] 0th quantile of arr, axis = 1 : [[17.] [15.] [ 4.]] 0th quantile of arr, axis = 1 : [[12] [ 6] [ 1]]7
arr : [[14, 17, 12, 33, 44], [15, 6, 27, 8, 19], [23, 2, 54, 1, 4]] 50th quantile of arr, axis = None : 15.0 0th quantile of arr, axis = None : 1] 50th quantile of arr, axis = 0 : [14.5 4. 19.5 4.5 11.5] 0th quantile of arr, axis = 0 : [14 2 12 1 4] 50th quantile of arr, axis = 1 : [17. 15. 4.] 0th quantile of arr, axis = 1 : [12 6 1] 0th quantile of arr, axis = 1 : [[17.] [15.] [ 4.]] 0th quantile of arr, axis = 1 : [[12] [ 6] [ 1]]8
arr : [[14, 17, 12, 33, 44], [15, 6, 27, 8, 19], [23, 2, 54, 1, 4]] 50th quantile of arr, axis = None : 15.0 0th quantile of arr, axis = None : 1] 50th quantile of arr, axis = 0 : [14.5 4. 19.5 4.5 11.5] 0th quantile of arr, axis = 0 : [14 2 12 1 4] 50th quantile of arr, axis = 1 : [17. 15. 4.] 0th quantile of arr, axis = 1 : [12 6 1] 0th quantile of arr, axis = 1 : [[17.] [15.] [ 4.]] 0th quantile of arr, axis = 1 : [[12] [ 6] [ 1]]7
import
0import
1import
2arr : [[14, 17, 12, 33, 44], [15, 6, 27, 8, 19], [23, 2, 54, 1, 4]] 50th quantile of arr, axis = None : 15.0 0th quantile of arr, axis = None : 1] 50th quantile of arr, axis = 0 : [14.5 4. 19.5 4.5 11.5] 0th quantile of arr, axis = 0 : [14 2 12 1 4] 50th quantile of arr, axis = 1 : [17. 15. 4.] 0th quantile of arr, axis = 1 : [12 6 1] 0th quantile of arr, axis = 1 : [[17.] [15.] [ 4.]] 0th quantile of arr, axis = 1 : [[12] [ 6] [ 1]]7
import
4import
5import
2arr : [[14, 17, 12, 33, 44], [15, 6, 27, 8, 19], [23, 2, 54, 1, 4]] 50th quantile of arr, axis = None : 15.0 0th quantile of arr, axis = None : 1] 50th quantile of arr, axis = 0 : [14.5 4. 19.5 4.5 11.5] 0th quantile of arr, axis = 0 : [14 2 12 1 4] 50th quantile of arr, axis = 1 : [17. 15. 4.] 0th quantile of arr, axis = 1 : [12 6 1] 0th quantile of arr, axis = 1 : [[17.] [15.] [ 4.]] 0th quantile of arr, axis = 1 : [[12] [ 6] [ 1]]7
import
8import
9import
2import
numpy as np
Các
arr : [20, 2, 7, 1, 34] Q2 quantile of arr : 7.0] Q1 quantile of arr : 2.0] Q3 quantile of arr : 20.0] 100th quantile of arr : 1.4]
arr : [[14, 17, 12, 33, 44], [15, 6, 27, 8, 19], [23, 2, 54, 1, 4]] 50th quantile of arr, axis = None : 15.0 0th quantile of arr, axis = None : 1] 50th quantile of arr, axis = 0 : [14.5 4. 19.5 4.5 11.5] 0th quantile of arr, axis = 0 : [14 2 12 1 4] 50th quantile of arr, axis = 1 : [17. 15. 4.] 0th quantile of arr, axis = 1 : [12 6 1] 0th quantile of arr, axis = 1 : [[17.] [15.] [ 4.]] 0th quantile of arr, axis = 1 : [[12] [ 6] [ 1]]7
numpy as np
2numpy as np
3 numpy as np
4arr : [[14, 17, 12, 33, 44], [15, 6, 27, 8, 19], [23, 2, 54, 1, 4]] 50th quantile of arr, axis = None : 15.0 0th quantile of arr, axis = None : 1] 50th quantile of arr, axis = 0 : [14.5 4. 19.5 4.5 11.5] 0th quantile of arr, axis = 0 : [14 2 12 1 4] 50th quantile of arr, axis = 1 : [17. 15. 4.] 0th quantile of arr, axis = 1 : [12 6 1] 0th quantile of arr, axis = 1 : [[17.] [15.] [ 4.]] 0th quantile of arr, axis = 1 : [[12] [ 6] [ 1]]3
import
2Code #2: Python3
Tham số: mảng: [mảng_like] mảng đầu vào. Q: Giá trị lượng tử. Trục: [int hoặc bộ dữ liệu của int] trục dọc theo đó chúng tôi muốn tính giá trị lượng tử. Nếu không, nó sẽ coi ARR là bị san phẳng [hoạt động trên tất cả các trục]. Trục = 0 có nghĩa là dọc theo cột và trục = 1 có nghĩa là làm việc dọc theo hàng. OUT: [Ndarray, Tùy chọn] Mảng khác nhau trong đó chúng tôi muốn đặt kết quả. Mảng phải có cùng kích thước như đầu ra dự kiến. Kết quả: Quantile QTH của mảng [giá trị vô hướng nếu trục không phải là không] hoặc mảng có giá trị lượng tử dọc theo trục được chỉ định.
Mã số 1: & NBSP;
=
2[
=
4,
=
6,
=
8,
[
0,
[
2[
3
=
2[
[
6,
2
,
20
0,
arr : [[14, 17, 12, 33, 44], [15, 6, 27, 8, 19], [23, 2, 54, 1, 4]] 50th quantile of arr, axis = None : 15.0 0th quantile of arr, axis = None : 1] 50th quantile of arr, axis = 0 : [14.5 4. 19.5 4.5 11.5] 0th quantile of arr, axis = 0 : [14 2 12 1 4] 50th quantile of arr, axis = 1 : [17. 15. 4.] 0th quantile of arr, axis = 1 : [12 6 1] 0th quantile of arr, axis = 1 : [[17.] [15.] [ 4.]] 0th quantile of arr, axis = 1 : [[12] [ 6] [ 1]]3
,
20
420
5arr : [[14, 17, 12, 33, 44], [15, 6, 27, 8, 19], [23, 2, 54, 1, 4]] 50th quantile of arr, axis = None : 15.0 0th quantile of arr, axis = None : 1] 50th quantile of arr, axis = 0 : [14.5 4. 19.5 4.5 11.5] 0th quantile of arr, axis = 0 : [14 2 12 1 4] 50th quantile of arr, axis = 1 : [17. 15. 4.] 0th quantile of arr, axis = 1 : [12 6 1] 0th quantile of arr, axis = 1 : [[17.] [15.] [ 4.]] 0th quantile of arr, axis = 1 : [[12] [ 6] [ 1]]7
20
7import
numpy as np
Các
arr : [[14, 17, 12, 33, 44], [15, 6, 27, 8, 19], [23, 2, 54, 1, 4]] 50th quantile of arr, axis = None : 15.0 0th quantile of arr, axis = None : 1] 50th quantile of arr, axis = 0 : [14.5 4. 19.5 4.5 11.5] 0th quantile of arr, axis = 0 : [14 2 12 1 4] 50th quantile of arr, axis = 1 : [17. 15. 4.] 0th quantile of arr, axis = 1 : [12 6 1] 0th quantile of arr, axis = 1 : [[17.] [15.] [ 4.]] 0th quantile of arr, axis = 1 : [[12] [ 6] [ 1]]7
numpy as np
2numpy as np
3 numpy as np
4arr : [[14, 17, 12, 33, 44], [15, 6, 27, 8, 19], [23, 2, 54, 1, 4]] 50th quantile of arr, axis = None : 15.0 0th quantile of arr, axis = None : 1] 50th quantile of arr, axis = 0 : [14.5 4. 19.5 4.5 11.5] 0th quantile of arr, axis = 0 : [14 2 12 1 4] 50th quantile of arr, axis = 1 : [17. 15. 4.] 0th quantile of arr, axis = 1 : [12 6 1] 0th quantile of arr, axis = 1 : [[17.] [15.] [ 4.]] 0th quantile of arr, axis = 1 : [[12] [ 6] [ 1]]3
import
2Đầu ra: & nbsp;
& nbsp; Mã số 2: & NBSP;
arr
=
arr
1arr
2___
arr : [[14, 17, 12, 33, 44], [15, 6, 27, 8, 19], [23, 2, 54, 1, 4]] 50th quantile of arr, axis = None : 15.0 0th quantile of arr, axis = None : 1] 50th quantile of arr, axis = 0 : [14.5 4. 19.5 4.5 11.5] 0th quantile of arr, axis = 0 : [14 2 12 1 4] 50th quantile of arr, axis = 1 : [17. 15. 4.] 0th quantile of arr, axis = 1 : [12 6 1] 0th quantile of arr, axis = 1 : [[17.] [15.] [ 4.]] 0th quantile of arr, axis = 1 : [[12] [ 6] [ 1]]7
20
9=
,
1 ,
2import
1import
2arr : [[14, 17, 12, 33, 44], [15, 6, 27, 8, 19], [23, 2, 54, 1, 4]] 50th quantile of arr, axis = None : 15.0 0th quantile of arr, axis = None : 1] 50th quantile of arr, axis = 0 : [14.5 4. 19.5 4.5 11.5] 0th quantile of arr, axis = 0 : [14 2 12 1 4] 50th quantile of arr, axis = 1 : [17. 15. 4.] 0th quantile of arr, axis = 1 : [12 6 1] 0th quantile of arr, axis = 1 : [[17.] [15.] [ 4.]] 0th quantile of arr, axis = 1 : [[12] [ 6] [ 1]]7
numpy as np
2,
7 ,
8=
,
1 2
12
2arr : [[14, 17, 12, 33, 44], [15, 6, 27, 8, 19], [23, 2, 54, 1, 4]] 50th quantile of arr, axis = None : 15.0 0th quantile of arr, axis = None : 1] 50th quantile of arr, axis = 0 : [14.5 4. 19.5 4.5 11.5] 0th quantile of arr, axis = 0 : [14 2 12 1 4] 50th quantile of arr, axis = 1 : [17. 15. 4.] 0th quantile of arr, axis = 1 : [12 6 1] 0th quantile of arr, axis = 1 : [[17.] [15.] [ 4.]] 0th quantile of arr, axis = 1 : [[12] [ 6] [ 1]]7
20
9=
,
1 ,
2import
1import
2arr : [[14, 17, 12, 33, 44], [15, 6, 27, 8, 19], [23, 2, 54, 1, 4]] 50th quantile of arr, axis = None : 15.0 0th quantile of arr, axis = None : 1] 50th quantile of arr, axis = 0 : [14.5 4. 19.5 4.5 11.5] 0th quantile of arr, axis = 0 : [14 2 12 1 4] 50th quantile of arr, axis = 1 : [17. 15. 4.] 0th quantile of arr, axis = 1 : [12 6 1] 0th quantile of arr, axis = 1 : [[17.] [15.] [ 4.]] 0th quantile of arr, axis = 1 : [[12] [ 6] [ 1]]7
numpy as np
2,
7 ,
8=
,
1 2
12
2Các
arr : [[14, 17, 12, 33, 44], [15, 6, 27, 8, 19], [23, 2, 54, 1, 4]] 50th quantile of arr, axis = None : 15.0 0th quantile of arr, axis = None : 1] 50th quantile of arr, axis = 0 : [14.5 4. 19.5 4.5 11.5] 0th quantile of arr, axis = 0 : [14 2 12 1 4] 50th quantile of arr, axis = 1 : [17. 15. 4.] 0th quantile of arr, axis = 1 : [12 6 1] 0th quantile of arr, axis = 1 : [[17.] [15.] [ 4.]] 0th quantile of arr, axis = 1 : [[12] [ 6] [ 1]]