How to split text into a list in Python with split()
Land Your First Data Science Job
A proven roadmap to prepare for $75K+ entry-level data roles. Perfect for Data Scientist ready to level up their career.
Splitting text is one way to transform your unstructured data into structured data.
Here is an example;
"Egg, Chamomile, Ham" => ["Egg", "Chamomile", "Ham"]
As you can see we transform a string into a list of items.
Here is the code
Here you are! You now know how to split some text into a list in Python with split().
More on fundamentals
If you want to know more about Python fundamentals without headaches... check out the other articles I wrote by clicking just here:
Land Your First Data Science Job
A proven roadmap to prepare for $75K+ entry-level data roles. Perfect for Data Scientist ready to level up their career.
Related Articles
Continue your learning journey with these related topics
Master Data Science in Days, Not Months 🚀
Skip the theoretical rabbit holes. Get practical data science skills delivered in bite-sized lessons – Approach used by real data scientist. Not bookworms. 📚