Guest User

Untitled

a guest
Jan 16th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. import pandas as pd
  2. import numpy as np
  3.  
  4. ser = pd.Series(np.random.randint(0,10,5))
  5. ser
  6. #o/p:
  7. #0 1
  8. #1 8
  9. #2 9
  10. #3 2
  11. #4 6
  12. #dtype: int32
  13.  
  14. ser = pd.Series(np.random.randint(0,10,5),index=['Tomatoes','Potato','Eggs','Onions','Garlic'])
  15. ser
  16. #o/p:
  17. #Tomatoes 9
  18. #Potato 7
  19. #Eggs 3
  20. #Onions 8
  21. #Garlic 9
  22. #dtype: int32
Add Comment
Please, Sign In to add comment