Skip to main content
It is better to explain the content of your response and format the code with the code quotations
Source Link

importTo add elements to a numpy as np

dummy = []array you can use the method 'append' passing it the array and the element that you want to add. For example:

dummy = np.append(dummy,12)import numpy as np dummy = [] dummy = np.append(dummy,12)

#thisthis will add new items in create an empty numpy array and add the number '12' to it

import numpy as np

dummy = []

dummy = np.append(dummy,12)

#this will add new items in empty numpy array

To add elements to a numpy array you can use the method 'append' passing it the array and the element that you want to add. For example:

import numpy as np dummy = [] dummy = np.append(dummy,12)

this will create an empty array and add the number '12' to it

Source Link
kiran
  • 13
  • 1

import numpy as np

dummy = []

dummy = np.append(dummy,12)

#this will add new items in empty numpy array