Numpy’s percentile method taking in 2 parameters usually an array(arr) and a percentile value(pct) simply returns the value inside the arr that has the percentile (pct) given as the 2nd parameter.
For example in the code snippet above the value returned should be 3 which is at the 50% percentile.
The confusion can come in when the parameter, axis, is introduced,which takes in values of either 0 for rows or 1 for columns. This will also go hand in hand with the input of an array of arrays.
In this case every array inside the array arr treated as a row and every corresponding item inside every row is treated as a column. For example the first row is [14,45,12,33,44] and the first column is [14,15,33]. So naturally, the first 50th percentile for the first row and column will be 15 and 33 respectively.
It should also be noted that if the items inside each row do not match it is impossible to calculate a percentile for axis 1, and the interpreter will throw an Exception. However, if an array of arrays is inputed and no axis parameter given then the arrays inside the array arr are flattened and you get only one value for the percentile. In the case above the 50th percentile returned would be 19.