#9 Basic Python Data Extraction from Text Files

Veröffentlicht am: 11 November 2022
auf dem Kanal: Data Skills for Everyone
16,005
131

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...


Auf dieser Seite können Sie das Online-Video #9 Basic Python Data Extraction from Text Files mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Data Skills for Everyone 11 November 2022 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 16,005 Mal angesehen und es wurde von 131 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!