Advertisement
sriyanto

Pandas DataFrame

Oct 2nd, 2022 (edited)
918
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.24 KB | None | 0 0
  1. import pandas as pd
  2.  
  3. data = {
  4.   "calories": [420, 380, 390],
  5.   "duration": [50, 40, 45]
  6. }
  7.  
  8. #load data into a DataFrame object:
  9. df = pd.DataFrame(data)
  10. print(df)
  11. #Return row 0 and 1:
  12. #use a list of indexes:
  13. print(df.loc[[0, 1]])
  14.  
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement