Guest User

Untitled

a guest
Oct 20th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. import numpy as np
  2. a = np.arange(1000000).reshape(1000,1000)
  3. print(a**2)
  4.  
  5. [[ 0 1 4 ..., 994009 996004 998001]
  6. [ 1000000 1002001 1004004 ..., 3988009 3992004 3996001]
  7. [ 4000000 4004001 4008004 ..., 8982009 8988004 8994001]
  8. ...,
  9. [1871554624 1873548625 1875542628 ..., -434400663 -432404668 -430408671]
  10. [-428412672 -426416671 -424420668 ..., 1562593337 1564591332 1566589329]
  11. [1568587328 1570585329 1572583332 ..., -733379959 -731379964 -729379967]]
  12.  
  13. In [1]: np.arange(1000000).dtype
  14. Out[1]: dtype('int32')
  15.  
  16. a=np.arange(1000000,dtype='int64').reshape(1000,1000)
  17.  
  18. import numpy
  19. a=numpy.arange(1000,dtype=object)
  20. a**20
  21.  
  22. {{{
  23. _mapper = [(nx.bool_, str2bool, False),
  24. (nx.integer, int, -1),
  25. (nx.floating, float, nx.nan),
  26. (complex, _bytes_to_complex, nx.nan + 0j),
  27. (nx.string_, bytes, asbytes('???'))]
  28. }}}
  29.  
  30. {{{
  31. _mapper = [(nx.bool_, str2bool, False),
  32. (nx.int64, int, -1),
  33. (nx.floating, float, nx.nan),
  34. (complex, _bytes_to_complex, nx.nan + 0j),
  35. (nx.string_, bytes, asbytes('???'))]
  36. }}}
Add Comment
Please, Sign In to add comment