AttributeError: 'numpy.ndarray' object has no attribute 'append'

0 votes

Hi Guys,

I am trying to append new  dataset in my array using append function, but It is showing me the error.

AttributeError: 'numpy.ndarray' object has no attribute 'append' 

How can I solve this error?

May 5 in Python by akhtar
• 25,210 points
10,327 views
Thank you. Your answer helped me to solve this error well.

1 answer to this question.

0 votes

Hi@akhtar,

If you trying to append data in your array, then you can use the below steps.

import numpy as np
arr = np.array([1,1,2])
arr1 = np.append(arr,4)
arr1
array([1, 1, 2, 4])
answered May 5 by MD
• 57,060 points

Related Questions In Python

0 votes
1 answer

AttributeError: 'numpy.ndarray' object has no attribute 'append'

Hi@Nilesh, You have created two empty lists. And ...READ MORE

answered Aug 10 in Python by MD
• 57,060 points
390 views
0 votes
1 answer

AttributeError: type object 'numpy.ndarray' has no attribute '__array_function__'

Hi@akhtar, I think numpy version is not compatible ...READ MORE

answered Apr 13 in Python by MD
• 57,060 points
1,415 views
+1 vote
1 answer

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

Hi@Noman, You created two empty list. And in ...READ MORE

answered May 17 in Python by MD
• 57,060 points
2,631 views
0 votes
0 answers

AttributeError: 'numpy.int32' object has no attribute 'map'

can any one suggest solution data['isLarge'] = data.size.map({'small' ...READ MORE

Sep 5 in Python by Mohammed
• 120 points
74 views
0 votes
1 answer

How to create Pandas series from numpy array?

Hi. Refer to the below command: import pandas ...READ MORE

answered Apr 1, 2019 in Python by Pavan
981 views
0 votes
1 answer
0 votes
1 answer

How to create Pandas series from dictionary?

Here's a sample script: import pandas as pd import ...READ MORE

answered Apr 1, 2019 in Python by Prateek
304 views
0 votes
1 answer

How to convert pandas dataframe to numpy array?

Irrespective of whether the dataframe has similar ...READ MORE

answered May 12, 2019 in Python by Rishi
5,465 views
+1 vote
1 answer
0 votes
1 answer

AttributeError: 'numpy.ndarray' object has no attribute 'append'

Hi@Nilesh, You created two empty lists. And in ...READ MORE

answered Aug 10 in Python by MD
• 57,060 points
148 views