Advertisement
Guest User

Untitled

a guest
Jul 25th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. import pandas as pd
  2. data = {'order_id' : [1, 2],
  3. 'order_date' : ['2014-01-01 00:00:00', '2014-01-01 00:00:00'],
  4. 'order_customer_id' : [1, 1],
  5. 'order_status' : ['COMPLETE', 'CLOSED']
  6. }
  7.  
  8. df = pd.DataFrame(data, columns = ['order_id', 'order_date', 'order_customer_id', 'order_status'])
  9.  
  10. #Accessing by column
  11. df.order_id
  12.  
  13. #Accessing by row index
  14. df.iloc[[1]]
  15.  
  16. #Setting index
  17. df1 = df.set_index(df.order_id)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement