I wrote a function that outputs 3 lists and want to make those lists each a column in a dataframe.
The function returns a tuple of 3 lists, containing text or lists of text.
Here is the function:
def function(pages = 0):
a = [title for title in range(pages)]
b = [[summary] for summary in title.summary]
c = [[summary2] for summary2 in title.summary2]
return a, b, c
data = function(pages = 2)
pd.DataFrame(data, columns = ['A', 'B', 'C'])
and the error says that I passed data with 2 columns while the columns have 3 columns. Can someone explain what is going on and how to fix it? Thank you!