0

For example, I have a list of strings: list_of_cuisines = ['indian', 'chinese', 'italian']

Now, I want to iterate over the above list and create dataframes of those cuisine names. Basically, I need a code like:

for cuisine in list_of_cuisines:
    cuisine = spark.sql(Select * from {input_table}".format(input_table = cuisine))

And then when I do a show() on any cuisine, it prints it's dataframe,

indian.show()
chinese.show()
italian.show()

0 Answers0