Although numpy.ndarray has a mean, max, std etc. method, it does not have a median method. For a list of all methods available for an ndarray, see the numpy documentation for ndarray.

It is available as a function that takes the array as an argument:

>>> import numpy as np
>>> a = np.array([1,2,3,4,5,6,7,8,9,10])
>>> np.median(a)
5.5

As you will see in the documentation for ndarray.mean, ndarray.mean and np.mean are "equivalent functions," so this is just a matter of semantics.

Answer from brianpck on Stack Overflow
🌐
GitHub
github.com › rapidsai › cuml › issues › 2952
[QST] Error ('numpy.ndarray' object has no attribute 'to_pandas') while running MNMG Kmeans Demo Notebook · Issue #2952 · rapidsai/cuml
October 11, 2020 - [QST] Error ('numpy.ndarray' object has no attribute 'to_pandas') while running MNMG Kmeans Demo Notebook#2952
Author   aamirshafi
🌐
GitHub
github.com › aertslab › pySCENIC › issues › 350
AttributeError: 'numpy.ndarray' object has no attribute 'quantile' when doing nGenesDetectedPerCell.quantile() · Issue #350 · aertslab/pySCENIC
December 22, 2021 - AttributeError Traceback (most recent call last) ~\AppData\Local\Temp/ipykernel_20596/2572477736.py in <module> 1 # STEP 4: Cellular enrichment (aka AUCell) from CLI 2 nGenesDetectedPerCell = np.sum(adata.X>0, axis=1) ----> 3 percentiles = nGenesDetectedPerCell.quantile([.01, .05, .10, .50, 1]) 4 print(percentiles) AttributeError: 'numpy.ndarray' object has no attribute 'quantile'
Author   hyjforesight
🌐
Stack Overflow
stackoverflow.com › questions › 66213943 › how-to-use-cov-function-on-ndarray
python - How to use .cov() function on ndarray? - Stack Overflow
February 15, 2021 - Then I try to do .cov() ( Calculating the covariance matrix ) on that array, but it gives me and error 'numpy.ndarray' object has no attribute 'cov'
🌐
GitHub
github.com › oegedijk › explainerdashboard › issues › 95
AttributeError: 'numpy.ndarray' object has no attribute 'columns' · Issue #95 · oegedijk/explainerdashboard
March 3, 2021 - AttributeError: 'numpy.ndarray' object has no attribute 'columns'#95 · Copy link · apavlo89 · opened · on Mar 3, 2021 · Issue body actions · This looks amazing but I can't run it on my dataset.
Author   apavlo89
🌐
Edureka Community
edureka.co › home › community › categories › python › numpy ndarray object has no attribute append
numpy ndarray object has no attribute append | Edureka Community
May 17, 2020 - This is part of my code, why it shows error. thanks in advance prets = [] pvols = ... : 'numpy.ndarray' object has no attribute 'append'
Find elsewhere
🌐
Quora
quora.com › Why-do-I-get-numpy-ndarray-object-has-no-attribute-append-error
Why do I get “numpy.ndarray object has no attribute append error”? - Quora
Summary The AttributeError is simply because ndarray has no append method. Choose the appropriate container or numpy function for your use case: list for frequent appends, preallocation for efficiency, or np.append/np.concatenate when copying ...
🌐
PyTorch Forums
discuss.pytorch.org › vision
AttributeError: 'numpy.ndarray' object has no attribute 'numpy' - vision - PyTorch Forums
April 9, 2019 - @ptrblck, Hi! I’m trying to visualize the adversarial images generated by this script: https://pytorch.org/tutorials/beginner/fgsm_tutorial.html This tutorial is used for the mnist data. Now I want to use for other data which is trained using the inception_v1 architecture, below is the gist ...
🌐
Arab Psychology
scales.arabpsychology.com › psychological scales › how to fix “‘numpy.ndarray’ object has no attribute ‘index’
How To Fix "'numpy.ndarray' Object Has No Attribute 'index'
December 4, 2025 - While the initial instinct might be to convert the array into a different object type, such as a Pandas structure, to access a missing attribute, the most efficient and idiomatic solution involves utilizing existing NumPy functions. Applying the list-specific index() method directly to a numpy.ndarray fundamentally overlooks the design philosophy of NumPy, which prioritizes performance through vectorized operations over standard Python sequence methods.
🌐
GitHub
github.com › waylandy › phosformer › issues › 1
'numpy.ndarray' object has no attribute 'numpy'. · Issue #1 · waylandy/phosformer
November 16, 2023 - Traceback (most recent call last): File "/Users/joshuasacher/phosformer/wip1_S234.py", line 17, in <module> predictions = Phosformer.predict_many( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/joshuasacher/phosformer/Phosformer/modules.py", line 204, in predict_many return np.array([i['pred'] for i in batch_job(kinases, peptides, **kwargs)]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/joshuasacher/phosformer/Phosformer/modules.py", line 204, in <listcomp> return np.array([i['pred'] for i in batch_job(kinases, peptides, **kwargs)]) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/joshuasacher/phosformer/Phosformer/modules.py", line 96, in batch_job pred = softmax(result['logits'].cpu(), axis=1)[:,1].numpy() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'numpy.ndarray' object has no attribute 'numpy'.
Author   jrsacher
🌐
PyTorch Forums
discuss.pytorch.org › t › how-to-fix-attributeerror-numpy-ndarray-object-has-no-attribute-cpu › 158960
How to fix: "AttributeError: 'numpy.ndarray' object has no attribute 'cpu'" - PyTorch Forums
August 11, 2022 - Hi All I have data from a dataloader which I get a data and corresponding label from it. I am trying to normalize the labels within a certain range using T.tonumpy_denormalize , however I get this error AttributeError: 'numpy.ndarray' object has no attribute 'cpu'.
🌐
PyMC Discourse
discourse.pymc.io › questions › v5
AttributeError: 'numpy.ndarray' object has no attribute 'at' when sampling LKJ Cholesky Covariance Priors for Multivariate Normal Models example with numpyro or blackjax - v5 - PyMC Discourse
February 26, 2025 - I wanted to try out sampling with numpyro on an AMD GPU using a model based on this example: https://www.pymc.io/projects/examples/en/latest/howto/LKJ.html It works with PyMC and nutpie samplers, but not with jax samplers. The code I run looks like the following: import pymc as pm import numpy def main(): RANDOM_SEED = 8927 rng = numpy.random.default_rng(RANDOM_SEED) N = 10000 mu_actual = numpy.array([1.0, -2.0]) sigmas_actual = numpy.array([0.7, 1.5]) Rho_actual ...
🌐
freeCodeCamp
forum.freecodecamp.org › python
Medical Data Visualizer AttributeError: 'numpy.ndarray' object has no attribute - Python - The freeCodeCamp Forum
May 12, 2023 - I completed the project on google colab and everything seems to be working once I copy it over to replit. The charts seem to look good. However, I’m getting the following 2 errors on test: ====================================================================== ERROR: test_bar_plot_number_of_bars ...