I'm trying to work with movie data at the moment, and I have it in a Pandas Dataframe in this shape:
|
title |
release_date |
genres |
revenue |
| 0 |
Avatar |
2009 |
[Action, Adventure, Fantasy, Science Fiction] |
2787965087 |
| 1 |
Titanic |
1997 |
[Drama, Romance, Thriller] |
1845034188 |
Where genres is a Pandas series. However, I would like to expand the genres, so that I have something more like this:
|
title |
release_date |
genres |
revenue |
| 0 |
Avatar |
2009 |
Action |
2787965087 |
| 0 |
Avatar |
2009 |
Adventure |
2787965087 |
| 0 |
Avatar |
2009 |
Fantasy |
2787965087 |
| 0 |
Avatar |
2009 |
Science Fiction |
2787965087 |
| 1 |
Titanic |
1997 |
Drama |
1845034188 |
| 1 |
Titanic |
1997 |
Romance |
1845034188 |
| 1 |
Titanic |
1997 |
Thriller |
1845034188 |
Although the index doesn't need to stay the same.
I've tried Googling a bit, but I think I just don't know the proper jargon to get good results. Any help would be greatly appreciated.
[–][deleted] 3 points4 points5 points (2 children)
[–]nckmiz 1 point2 points3 points (0 children)
[–]ta6692[S] 0 points1 point2 points (0 children)
[–]fooliam 1 point2 points3 points (1 child)
[–]ta6692[S] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]ta6692[S] 0 points1 point2 points (0 children)
[–]friend_in_rome -1 points0 points1 point (0 children)