Course materials Github: https://github.com/machinelearningplu...
Join Pandas course on ML+: https://edu.machinelearningplus.com/c...
-----------------------------------------
Converting a wide data frame to a long data frame. And a long data frame back to a wide data frame is an interesting concept. It has a practical use case in most organizations in real world settings.
So let's first understand what converting a wide data frame what is a wide data frame first, and what is a long data frame?
Checkout complete Data Scientist Learning Path here: https://edu.machinelearningplus.com/s...
Join ML+ membership for exclusive Data science content
🔹 How to Convert Wide Dataframe to Long and Back in Pandas?
Now, we know we have seen the Titanic data frame, let's have a look at it. Here in this Titanic data frame, we are having a lot of features of individual passengers in various columns of this data frame. This is called as wide data frame where you have multiple features in multiple columns in the same data frame.
Now, it is possible to convert this data frame to a long data frame where you have very few features. Mandatory feature would be an ID column, let's say you have passenger ID can be the ID ID column for this passenger ID or the name both of this could be an ID column, because every row here corresponds to one single passenger right.
So it could be ID must be one column, then you also need to have a feature column and a value column. So, with the long data after conversion, it would look like so passenger ID one feature name has survived and the value is zero. Likewise, there could be another entry passenger ID one feature name or speak last and value equal to three.
Likewise, you keep on arranging the values in this fashion along the rows at the end of the day, you will have only three different columns, it can be more columns also, but three primary columns will be present. This is a typical process of converting a wide data frame to a long data frame. Now, why is this needed?
What is the use case for this? Now in most organizations in many organizations, where you are having various different projects, typical project could be you have a visualization dashboard. In software such as Tableau or any other software, you have a certain dashboard that your team has created.
#machinelearningplus #python #pandasdatascience
Let me know in the comments section if you have any questions!
🤝 Like, Share, Subscribe for more!
Follow us on our social media handles for all updates, events and live sessions-
✅ Instagram: / machinelearningplus
✅ LinkedIn: / machine-learning-plus
✅ YouTube: / numyard
✅ Twitter: / r_programming
✅ Website: https://www.machinelearningplus.com/
If you enjoyed this video, be sure to throw it a like and make sure to subscribe to not miss any future videos!
Thanks for watching!