Guest User

Untitled

a guest
Mar 20th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. def asarray(a, dtype=None, order=None):
  2. """Convert the input to an array...
  3. """
  4. return array(a, dtype, copy=False, order=order)
  5.  
  6. In [10]: t = np.arange(10)
  7.  
  8. In [11]: p = pd.DataFrame(t)
  9.  
  10. In [12]: t
  11. Out[12]: array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
  12.  
  13. In [13]: p
  14. Out[13]:
  15. 0
  16. 0 0
  17. 1 1
  18. 2 2
  19. 3 3
  20. 4 4
  21. 5 5
  22. 6 6
  23. 7 7
  24. 8 8
  25. 9 9
  26.  
  27. In [14]: t[:3] = 4
  28.  
  29. In [15]: t
  30. Out[15]: array([4, 4, 4, 3, 4, 5, 6, 7, 8, 9])
  31.  
  32. In [16]: p
  33. Out[16]:
  34. 0
  35. 0 4
  36. 1 4
  37. 2 4
  38. 3 3
  39. 4 4
  40. 5 5
  41. 6 6
  42. 7 7
  43. 8 8
  44. 9 9
Add Comment
Please, Sign In to add comment