Python is an excellent language for new programmers to learn. Its intuitive nature makes it easy for most people to quickly understand what the codes and algorithms are actually doing. In this article and many others in the future, we will be going over the many ways one can use Python to solve beginner exercises to more complicated problems. Note that for all these articles I will be making use of a Jupyter Notebook to show the results of the code.

Let’s begin!

So lets imagine you were given a list of words and had to extract specific metrics from it. How would you go about that?

The Words

wordy_list = ['dog cat bear tiger tiger tiger dog dog cat cat bear   
               tiger tiger panda panda panda iguana iguana']

The first thing you may notice is that list above does not lend itself very well to data analysis. A key issue is that the data is kept as a single string. Our first step then is to break the string into a list of words. To do that we use the trusty split() function in Python.

list_of_words = wordy_list.split()

#data-science #python #programming #database

Pythonic Tip & Tricks - Frequency Extraction
1.95 GEEK