Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

AttributeError: ‘numpy.ndarray’ object has no attribute ‘append’

# import numpy library
import numpy as np

# define NumPy array
cars = np.array(["Toyota", "Volkswagen", "Tesla", "Ford"])

# append the new cars into numpy array
cars = np.append(cars, ["Chevrolet", "Jeep"])

# print the appended cars
print(cars)
Source by itsmycode.com #
 
PREVIOUS NEXT
Tagged: #object #attribute
ADD COMMENT
Topic
Name
5+9 =