Python: convert variables into correct format for DataFrame
I have 3 variables that I would like to use to build my dataset but since they are in a weird shape/format, I had no success so far. I'm quite new to this and really appreciate any help!!
The 3 variables I have are:
print(newspaper)
['Bolero']
['Schweizer Illustrierte Style']
['Bolero']
print(title)
['Schönheit und Tragik']
['magie pur']
['Das sind unsere Favoriten']
print(pubDate)
['2007-01-01']
['2007-01-01']
['2007-01-01']
It seems to like all variables are a list of lists, but I'm not quite sure. However, since the data is scrapped from a private website, I can't post the entire code here, but I hope this is already enough for you to access what the problem is with that variable format.
What I would like to have is a dataset of this format:
Newspaper | Title | PubDate |
---|---|---|
Bolero | Schönheit und Tragik | 2007-01-01 |
Schweizer Illustrierte Style | magie pur | 2007-01-01 |
Bolero. | Das sind unsere Favoriten | 2007-01-01 |
Topic dataframe data-formats python
Category Data Science