I think I've figured it out. The .remove() method is a list method, not an ndarray method. So by using array.tolist() I can then apply the .remove() method and get the required result.

Answer from berkelem on Stack Overflow
🌐
Researchdatapod
researchdatapod.com › home › how to solve python attributeerror: ‘numpy.ndarray’ object has no attribute ‘remove’
How to Solve Python AttributeError: 'numpy.ndarray' object has no attribute 'remove' - The Research Scientist Pod
May 16, 2022 - If you encounter this error, you can get the indices of the values you want to remove using numpy.where then use numpy.delete to remove those values. Alternatively, you could convert the array to a list and use the remove method.
Discussions

usage of np.delete
you don't do np.delete, you do grades.delete. np is a library (you imported), grades is a ndarray. Also see https://numpy.org/doc/stable/reference/generated/numpy.delete.html More on reddit.com
🌐 r/learnpython
2
1
April 29, 2021
Medical Data Visualizer AttributeError: 'numpy.ndarray' object has no attribute
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 ... More on forum.freecodecamp.org
🌐 forum.freecodecamp.org
2
0
May 12, 2023
python - AttributeError: 'numpy.ndarray' object has no attribute 'columns' - Stack Overflow
I'm trying to create a function to remove the features that are highly correlated with each other. However, I am getting the error ''AttributeError: 'numpy.ndarray' object has no attribute 'column... More on stackoverflow.com
🌐 stackoverflow.com
AttributeError: 'numpy.ndarray' object has no attribute 'pop'
Well, NumPy arrays do not have a .pop() method; those are on regular Python lists instead. You seem to use this for omitting grades less than 5. Maybe NumPy's boolean indexing could work here, e.g. marks = np.array([ [8.0, 9.0, 10.0], [4.0, 9.0, 8.0], [8.0, 3.0, 8.0], [10.0, 9.0, 5.0], [9.0, 9.0, 4.0] ]) omitted_5 = np.array([ row[~(row < 5)] # Keep those that are NOT less than 5 for row in marks ]) # array([array([ 8., 9., 10. ]), # array([ 9., 8. ]), # array([ 8., 8. ]), # array([ 10., 9., 5. ]), # array([ 9., 9. ])], # dtype=object) However, this results in an irregularly shaped data, which interferes with the GPA computation with credits. QUESTION: How would marks with omitted values behave with the GPA computation? For example, the last set of marks [9.0, 9.0, 4.0] which will essentially be filtered into [9.0, 9.0] Will it only get multiplied to [2, 2]? (Filtered credits values) Or should it instead be filtered into [9.0, 9.0, 0.0] and fully multiplied with [2, 2, 1]? (Unfiltered credits) More on reddit.com
🌐 r/learnpython
4
1
November 28, 2022
🌐
Markaicode
markaicode.com › home › python › fix 'numpy.ndarray object has no remove attribute' error (3 working solutions)
Fix 'numpy.ndarray Object Has No remove Attribute' Error (3 Working Solutions) | Markaicode
March 3, 2026 - The problem: You want to remove elements by their value, not position · My solution: Use boolean masks - this changed how I think about NumPy
🌐
TheLinuxCode
thelinuxcode.com › home › resolving the numpy "attributeerror: ‘numpy.ndarray‘ object has no attribute ‘remove‘"
Resolving the NumPy "AttributeError: ‘numpy.ndarray‘ object has no attribute ‘remove‘" – TheLinuxCode
December 27, 2023 - arr = np.array([1, 2, 3]) new_arr = np.delete(arr, 1) # Does not alter arr · If you want an in-place change, assign back to the variable: arr = np.array([1, 2, 3]) arr = np.delete(arr, 1) # Updates arr · Finally, while deleting unwanted elements is useful, also consider if NumPy masking or slicing would better serve your use case without data movement. I hope these removing and troubleshooting tips help you banish that nasty "AttributeError: ‘numpy.ndarray‘ object has no attribute ‘remove‘" from your NumPy code for good!
🌐
Linux Hint
linuxhint.com › fix-attributeerror-numpy-ndarray-object-no-attribute-remove
Linux Hint – Linux Hint
Linux Hint LLC, [email protected] 1210 Kelly Park Circle, Morgan Hill, CA 95037 Privacy Policy and Terms of Use
🌐
Reddit
reddit.com › r/learnpython › usage of np.delete
r/learnpython on Reddit: usage of np.delete
April 29, 2021 -

Hey lads n gals

I am working on an assignment, where we are doing a grading system for students on the -3 to 12 scale...

here is the code so far:

import numpy as np

from RoundGrade import roundGrade

def computeFinalGrade(grades):

if -3 in grades:

return -3

if len(grades)==1:

return grades[0]

if len(grades)>=2:

grademin=grades.delete(min(grades))

average=np.mean(grademin)

return roundGrade(average)

grades=np.array([6,9,2,5,2])

print(computeFinalGrade(grades))

however this gives me the error messege:

'numpy.ndarray' object has no attribute 'delete'

i have tried converting the array to a list, but it doesn't help

thanks <3

Find elsewhere
🌐
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: =============================…
🌐
Reddit
reddit.com › r/learnpython › attributeerror: 'numpy.ndarray' object has no attribute 'pop'
r/learnpython on Reddit: AttributeError: 'numpy.ndarray' object has no attribute 'pop'
November 28, 2022 -

Write a function to calculate accumulated GPA (omit grade <5).

def gpa_of_pass(marks, credits):
    gpa_list=[]
    for i in range(len(marks)):
        for j in range(len(marks[i])):
            if marks[i][j] < 5:
                marks=marks[i].pop(j)
    for i in marks:
        for j in i:
            gpa_list.append(np.dot(i,credits)/sum(credits))
    return gpa_list

marks = np.array([
    [8.0, 9.0, 10.0],
    [4.0, 9.0, 8.0],
    [8.0, 3.0, 8.0],
    [10.0, 9.0, 5.0],
    [9.0, 9.0, 4.0]
])

credits = np.array([2, 2, 1])
gpa_of_pass(marks, credits)

I ran a for loop to remove the grade <5 before calculating the GPA but I got the error in the title. Would you please have any suggestions? Thank you so much!

🌐
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
Answer: The error is exactly what it says on the tin: NumPy’s ndarray object has no attribute [code ]append[/code] defined in its API. The error in question, for reference. We can start by asking, what is a numpy.ndarray? NumPy is an incredibly useful library for data manipulation in Python, wh...
🌐
Stack Overflow
stackoverflow.com › questions › 48783749 › numpy-ndarray-object-has-no-attribute-delete
python - 'numpy.ndarray' object has no attribute 'delete' - Stack Overflow
Instead, you have to use numpy.delete(contours0[0], index) where index is the position of i ... Find the answer to your question by asking. Ask question ... See similar questions with these tags. ... Gruesome death in time-dilation story: Guy halfway in, halfway out of spheres with different time speeds · What did Eddie Redmayne throw at the French lorry driver? Why did driver catch whatever object that Eddie Redmayne threw?
🌐
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 ...
🌐
GeeksforGeeks
geeksforgeeks.org › how-to-fix-numpy-ndarray-object-has-no-attribute-index
How to Fix: ‘numpy.ndarray’ object has no attribute ‘index’ - GeeksforGeeks
November 28, 2021 - This error arises because numpy's float attribute has been deprecated and removed in favor of using standard Python types. In this article, we will learn how to fix "AttributeError: m ... When working with NumPy we might encounter the error ...
🌐
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   waylandy
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.ndarray.html
numpy.ndarray — NumPy v2.4 Manual
>>> np.ndarray((2,), buffer=np.array([1,2,3]), ... offset=np.int_().itemsize, ... dtype=int) # offset = 1*itemsize, i.e. skip first element array([2, 3]) ... View of the transposed array. ... Python buffer object pointing to the start of the array’s data.
🌐
Groups
rasterio.groups.io › g › main › topic › attributeerror › 104814395
AttributeError: 'numpy.ndarray' object has no attribute 'transform' when rasterio.mask()
March 9, 2024 - You logged in using a passkey from another device. For faster access next time, add a passkey to this device · Note: Your email address is included with the abuse report
🌐
Reddit
reddit.com › r/manim › attributeerror: 'numpy.ndarray' object has no attribute 'move_to'
r/manim on Reddit: AttributeError: 'numpy.ndarray' object has no attribute 'move_to'
August 13, 2020 -

Hello there.

I started doing manim a few weeks ago and, since there's no official documentation, I've been trying to replicate some of the scenes of 3b1b's old proyects. Specifically, I'm trying to replicate this animation ( https://www.youtube.com/watch?v=k7RM-ot2NWY at 0:37), but whenever I try to render the file, this error appears: "AttributeError: 'numpy.ndarray' object has no attribute 'move_to'".

I've already spend hours looking through the manimlib files but i can't make sense out of this.

Heres the code of the animation that I've got so far:

from manimlib.imports import *

class VectoresComoEscalares(VectorScene):
CONFIG = {
"axis_config": {
"stroke_color": WHITE,
"stroke_width": 2,
"stroke_opacity": 0.8,
        },
"background_line_style": {"stroke_width": 2, "stroke_opacity": 0.5,},
"vcoords": ([3, 2]),
"vcolor": ORANGE,
    }
def construct(self):
        grid = NumberPlane(**self.CONFIG)
self.add(grid)
self.lock_in_faded_grid()
self.play(ShowCreation(grid), run_time=2)
self.wait()
        kwargs = {
"stroke_width": 4,
        }
        vector = self.add_vector(self.vcoords, self.vcolor, **kwargs)
        array, x_line, y_line = self.vector_to_coords(vector)
self.add(array)
self.wait()
        new_array = self.ideas_generales_escalares(array, vector)
self.scale_basis_vectors(new_array)
self.show_symbolic_sum(new_array, vector)
def ideas_generales_escalares(selfarrayvector):
        startmo = self.get_mobjects()
        txt = TextMobject(
"Vean cada coordenada como un escalar.", tex_to_color_map={"escalar": RED}
        )
        txt.to_edge(DOWN)
        x, y = array.get_entries()
        new_x = x.copy().scale(2).set_color(X_COLOR)
        new_x.move_to(3 * LEFT + 2 * UP)
        new_y = y.copy().scale(2).set_color(Y_COLOR)
        new_y.move_to(3 * RIGHT + 2 * UP)
        i_hat, j_hat = self.get_basis_vectors()
        new_i_hat = Vector(self.vcoords[0] * i_hat.get_end(), color=X_COLOR)
        new_j_hat = Vector(self.vcoords[1] * j_hat.get_end(), color=X_COLOR)
        g1 = VGroup(i_hat, new_i_hat).shift(3 * LEFT)
        g2 = VGroup(i_hat, new_j_hat).shift(3 * RIGHT)
        new_array = Matrix([new_x.copy(), new_y.copy()])
        new_array.scale(0.5)
        new_array.shift(
-new_array.get_boundary_point(-vector.get_end()) + 1.1 * vector.get_end()
        )
self.remove(*startmo)
self.play(Transform(x, new_x), Transform(y, new_y), Write(txt))
self.play(FadeIn(i_hat), FadeIn(j_hat))
self.wait()
self.play(FadeIn(i_hat), FadeIn(j_hat))
self.wait()
self.play(Transform(i_hat, new_i_hat), Transform(j_hat, new_j_hat), run_time=3)
self.wait()
        startmo.remove(array)
        new_x, new_y = new_array.get_entries()
self.play(
Transform(x, new_x),
Transform(y, new_y),
FadeOut(i_hat),
FadeOut(j_hat),
Write(new_array.get_brackets()),
FadeIn(VMobject(*startmo)),
FadeOut(txt),
        )
self.remove(x, y)
self.add(new_array)
return new_array

🌐
GitHub
github.com › pierluigiferrari › ssd_keras › issues › 44
AttributeError: 'numpy.ndarray' object has no attribute 'pop' · ...
January 10, 2018 - /usr/local/lib/python2.7/dist-packages/keras/legacy/interfaces.pyc in wrapper(*args, **kwargs) 85 warnings.warn('Update your `' + object_name + 86 '` call to the Keras 2 API: ' + signature, stacklevel=2) ---> 87 return func(*args, **kwargs) 88 wrapper._original_function = func 89 return wrapper /usr/local/lib/python2.7/dist-packages/keras/engine/training.pyc in fit_generator(self, generator, steps_per_epoch, epochs, verbose, callbacks, validation_data, validation_steps, class_weight, max_queue_size, workers, use_multiprocessing, shuffle, initial_epoch) 2113 batch_index = 0 2114 while steps_don
Author   pierluigiferrari