Solidify Your Python Chops in 3 Steps
-
Practice beats study, so practice, practice, practice.
-
If you need more practice with dictionaries and lists of dictionaries,
- Play with the examples and exercises from https://www.w3schools.com/python/python_dictionaries.asp.
- Play with https://gist.github.com/ryanorsinger/328b3ed08e1e9d168db26f3ab97d6400
- Review and experiment with this way of approaching looping problems: https://github.com/CodeupClassroom/florence-python-exercises/blob/main/how-to-solve-looping-problems.ipynb
- Experiment with solving these https://gist.github.com/zgulde/2043cba6072fe5b55b272513ae575577 problems
- Don't stress out too much about working with lists of dictionaries. Pandas makes quick work out of them. For example, the code
pd.DataFrame(list_of_dictionaries)
will create a dataframe where all the keys are columns and each row is a corresponding set of values (assuming each dictionary has the same keys, which they usually do)
- Overall, I'd recommend working through the 101 Exercises 3 to 5 times. Specifically, I recommend saving a copy of https://github.com/ryanorsinger/101-exercises/blob/main/101-exercises.ipynb locally and doing the following:
- First, solve as many of the problems as you can with the help of your favorite search engine and some gumption.
- Then, import numpy and pandas at the top and approach these same problems through the numpy/pandas way of doing things, instead of using loops.