Question: sales _ ranks = { } with gzip.open ( drive / MyDrive / meta _ Clothing _ Shoes _ and _ Jewelry.jsonl.gz )

sales_ranks ={}
with gzip.open("drive/MyDrive/meta_Clothing_Shoes_and_Jewelry.jsonl.gz") as products:
for i, product in enumerate(products):
#Uncomment these lines to reduce the debug cycle for troubleshooting only !!!
#if i >10000: # 10000 because we don't hit Nike products for a while
# break
data = json.loads(product)
categories =[]
for category_list in data.get("categories",[]):
_catlist =[]
for item in category_list:
if item.strip()!= item:
print(category_list)
_catlist.append(item.lower())
categories +=_catlist
if "nike" in categories:
if data.get("salesRank"):
# TODO: Complete the extraction of sales rank and populate
# that information into the sales_ranks dictionary, keyed
# by the asin value.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!