firaki12345

walmart python code

Jan 31st, 2021
704
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. import json
  2. import pandas as pd
  3.  
  4.  
  5. with open("walmart.json") as f:
  6. data = json.load(f)
  7.  
  8. walmart = data["items"]
  9.  
  10.  
  11. wdf = pd.DataFrame(walmart,columns=["productId","primaryOffer"])
  12.  
  13.  
  14. print(wdf.loc[0,"primaryOffer"])
  15.  
  16.  
  17. pd.set_option('display.max_colwidth', None)
  18.  
  19.  
  20. print(wdf)
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
Advertisement
Add Comment
Please, Sign In to add comment