Python Forum
np.arrange error - no attribute
Thread Rating:
  • 2 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
np.arrange error - no attribute
#1
Python novice.
I am using the Canopy Python editor.
I cannot get the arrange command to work.
----------------------------------------
import numpy as np
pp=np.arrange(10)
pp=np.arrange(1,10)
pp=np.arrange(1,10,1)

all commands give error:
AttributeError: 'module' object has no attribute 'arrange'
Tried many other combinations for argument, no luck.
Reply
#2
Use code tags
Reply
#3
Numpy has arange() function, not arrange(). Your examples should be like
pp = np.arange(10)
Reply
#4
(Jul-01-2017, 12:44 PM)pksherard Wrote: all commands give error:
AttributeError: 'module' object has no attribute 'arrange'
Tried many other combinations for argument, no luck.

For future reference, the error is telling you that the function you're trying to call doesn't exist.  Moving the arguments around isn't going to change that fact... because the function isn't there, there aren't any combination of arguments which would ever be valid.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Using SHAP Library for my LSTM model - "Attribute Error" vatsalmtailor 0 2,019 Jul-13-2022, 04:34 PM
Last Post: vatsalmtailor
  error "list object has no attribute transpose()" usercat123 4 4,145 Jan-28-2022, 12:01 PM
Last Post: usercat123
  Attribute Error Raiden_Arctica 4 4,047 Mar-13-2021, 11:09 AM
Last Post: Raiden_Arctica
  Attribute error in Dataframes deshanish 1 2,359 Jul-15-2020, 08:38 AM
Last Post: snippsat
  Attribute error - Sympy VictorG8 1 4,870 Apr-09-2020, 06:03 PM
Last Post: snippsat
  [pandas] How to re-arrange DataFrame columns SriMekala 8 4,827 Jun-22-2019, 12:55 AM
Last Post: scidam
  while creating a array using numpy.arrange, how to negate only the last 50 numbers? vicky53 1 2,631 Apr-06-2019, 11:52 AM
Last Post: scidam
  How to arrange the four pictures of a matplotlib.pyplot? vokoyo 0 2,725 Apr-04-2019, 10:58 PM
Last Post: vokoyo
  NLTK Download Attribute error laila1a 1 8,412 Jan-27-2019, 12:03 AM
Last Post: Larz60+
  Help to arrange correct input array structure mogensen24 1 2,347 Oct-05-2018, 06:09 PM
Last Post: j.crater

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020