0

I'm looping through list of jsons and storing them in a dataframe. for each iteration i want to write the dataframe into excel with different sheets. how to achieve this?

for item in data:

  #removing empty columns in raw data
  drop_none = lambda path, key, value: key is not None and value is not None
  cleaned = remap(item, visit=drop_none)
  new_data=flatten(cleaned)
  #my_df = new_data.dropna(axis='columns', how='all') # Drops columns with all NA values
  dfFromRDD2 = spark.createDataFrame(new_data)

I want to save the dataframe dfFromRDD2 to excel with different sheets on each iterations. is their a way to do it using python?

0 Answers0