Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. inputs = np.array([23.,56,69])
  2.  
  3. def DoModel(array):
  4. ... do magic ...
  5. return newArray
  6.  
  7. Outputs= np.array([np.array([DoModel(inputs) for x in xrange(iterations)])
  8.  
  9. def RunModel(iterations, inputs):
  10. # generate a 1D array of length iteration containing the input array
  11. myArray = np.full((1,int(iterations)), inputs)
  12.  
  13. Outputs = RunModel(iterations, inputs)
  14. # run my function on the array
  15. return DoModel(empty)
  16.  
  17. ValueError: could not broadcast input array from shape (3) into shape (1,5)
  18.  
  19. myArray = np.full((1,int(iterations)), inputs,dtype=np.ndarray
  20. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement