Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. In[25]:%timeit 12345 in df.CID
  2. Out[25]:89.8 µs ± 254 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)
  3.  
  4. In[26]:%timeit 12345 in df['CID']
  5. Out[26]:42.3 µs ± 334 ns per loop (mean ± std. dev. of 7 runs, 10000 loops each)
  6.  
  7. In[27]:type( df.CID)
  8. Out[27]: pandas.core.series.Series
  9.  
  10. In[28]:type( df['CID'])
  11. Out[28]: pandas.core.series.Series
  12.  
  13. df = pd.DataFrame({'A': [1, 2, 3]})
  14. df.A
  15.  
  16. 0 1
  17. 1 2
  18. 2 3
  19. Name: A, dtype: int64
  20.  
  21. df.pop
  22. # <bound method NDFrame.pop of ...>
  23.  
  24. df['pop'] = [4, 5, 6]
  25. df
  26. A pop
  27. 0 1 4
  28. 1 2 5
  29. 2 3 6
  30.  
  31. df.pop
  32. # <bound method NDFrame.pop of ...>
  33.  
  34. df['pop']
  35.  
  36. 0 4
  37. 1 5
  38. 2 6
  39. Name: pop, dtype: int64
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement