Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 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.
Quote
#2
Use code tags
Quote
#3
Numpy has arange() function, not arrange(). Your examples should be like
pp = np.arange(10)
Quote
#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.
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  .pyplot has not attribute zlim SchroedingersLion 5 127 Aug-25-2018, 01:31 PM
Last Post: SchroedingersLion
  Fatal Python error: init_sys_streams: can't initialize sys standard streams Attribute FatalPythonError 24 605 Aug-22-2018, 06:10 PM
Last Post: FatalPythonError
  [split] np.arrange error - no attribute gyan 2 76 Aug-19-2018, 05:38 PM
Last Post: micseydel
  Error object has no attribute text hcyeap 1 172 Aug-13-2018, 01:07 PM
Last Post: snippsat
  Getting Python error: AttributeError: 'tuple' object has no attribute 'Text' dageci 2 313 Jul-26-2018, 08:34 PM
Last Post: buran
  Attribute error RandomCoder 1 163 Jul-24-2018, 05:52 PM
Last Post: gontajones
  beginner - object has no attribute johnkyp 2 366 Apr-11-2018, 08:24 PM
Last Post: johnkyp
  Attribute error Truman 1 259 Apr-08-2018, 08:41 PM
Last Post: snippsat
  Re-arrange lines when adding new if statement bghayad 3 312 Mar-21-2018, 07:29 PM
Last Post: nilamo
  keyboard.is_pressed attribute error sterretje 3 454 Mar-18-2018, 09:03 AM
Last Post: sterretje

Forum Jump:


Users browsing this thread: 1 Guest(s)