#9 Basic Python Data Extraction from Text Files

Описание к видео #9 Basic Python Data Extraction from Text Files

Driving Question
I have a text file with textual descriptions and numeric summaries of sales records. I need to extract portions of this data containing sales records and present the information sorted for easy viewing and interpretation.

My goal is to write code to read the text file and print out the 5 top-selling notable products, in descending order of sales. The expected output for the given file should look as follows:

1. Phone
2. Tablet
3. RGB Coffee Mug
4. PC
5. Webcam


In today’s tutorial, we will tackle another beginner-level task working with text files. We will apply some basic python string functions to both clean and structure the input data for subsequent analysis. In addition, we will make good use of python list comprehensions to deal with looping over the data.
What we’ll cover today:
0:00 Introduction
2:50 Read in the text file
4:20 Parse and clean the data
8:37 Extract data needed for further steps
12:27 Sort the data
18:17 Format data for output

*Additional References*:
This tutorial assumes a basic understanding of Python strings. Also, some basic understanding of reading and writing files will be sufficient.

Source Code
Visit the following GitHub repository to follow along with the code used in this tutorial
https://github.com/quizem/data-skills...

Комментарии

Информация по комментариям в разработке