How to Find Common Elements of Two Lists in Python

Problem Formulation and Solution Overview In this article, you’ll learn how to locate and return the common elements of two (2) lists in Python. To make it more fun, we have the following running scenario: Bondi Brokers offers two (2) Marketable Bonds: 3-years and 5-years. Each yields different amounts. To determine which Bond best suits … Read more

How to Sum two DataFrame Columns

Problem Formulation and Solution Overview In this article, you’ll learn how to sum two (2) DataFrame columns in Python. To make it more fun, we have the following running scenario: Wine-It, a subscription-based crate company, ships a different bottle of wine to subscribers each month. They have 50,000+ users and need a quick way to … Read more

How to Convert JSON to Pandas DataFrame

Problem Formulation and Solution Overview In this article, you’ll learn how to read a JSON string and convert it to a Pandas DataFrame in Python. To make it more fun, we have the following running scenario: Antoine, a Curator from the Smithsonian Museum, is taking their Egyptian Collection on the road. Antoine has received a … Read more

How to Read an XLS File in Python?

Problem Formulation and Solution Overview In this article, you’ll learn how to read an XML file and format the output in Python. To make it more fun, we have the following running scenario: Arman, a Music Appreciation student at the Royal Conservatory of Music, has been given course materials in an XML file format. Arman … Read more

How to Read a Dictionary from a File

Problem Formulation and Solution Overview In this article, you’ll learn how to read in a Dictionary file and format the output in Python. To make it more fun, we have the following running scenario: Jeff Noble, a Marine Archeologist, has put together a team to search for shipwrecks each month. This month, they will search … Read more

How to Remove Newlines from a List

Problem Formulation and Solution Overview In this article, you’ll learn how to remove the newline character from list elements in Python. To make it more fun, we have the following running scenario: Watts Security has contacted you for assistance. They have been given a flat file containing user account breaches. Upon review, they notice each … Read more

How to Create a List of the Alphabet

Problem Formulation and Solution Overview In this article, you’ll learn how to create a list containing the alphabet in Python. To make it more fun, we have the following running scenario: Ms. Smith, a Grade 2 teacher at Oakwood Public School, wants to strengthen her student’s Alphabet skills and needs your help. She would like … Read more

How to Sort a List of Tuples by Second Value

Problem Formulation and Solution Overview In this article, you’ll learn how to sort a list of tuples by the second value in Python. To make it more fun, we have the following running scenario: BridgeTech is a bridge restoration company. They have asked you to sort and return the Top 10 elements from the Periodic … Read more

How to Count the Occurrences of a List Element

Problem Formulation and Solution Overview In this article, you’ll learn how to count the occurrences of a selected List element in Python. To make it more fun, we have the following running scenario: A Teacher from Orchard Elementary would like a script created for the 4th-grade students called “Count-Me“. She would like this script to … Read more

How to Generate a Sequence of Numbers

Problem Formulation and Solution Overview In this article, you’ll learn how to create a sequence of numbers in Python. To make it more fun, we have the following running scenario: Lux Lottery has decided to create a new Quick-Pick game called Lux-150. This game is based on seven (7) random numbers between 1 and 150 … Read more