Project Overview 💡
In this project, you’ll learn how to read numerical data from a series of text files and visualize it using matplotlib
. This project is perfect for practicing file handling, data processing, and plotting in Python.
Challenge Yourself! 🚀
Before checking the solution, try creating a script that reads a number from each .txt
file in a folder and plots the data.
Task:
Write a Python program that:
Reads all
.txt
files from a directory
You can download and use the text files in the link below.Extracts the number in each file
Plots those numbers on a line chart using the filenames (without .txt) as labels
Expected Output:
A line graph showing numbers from each file with the file name as the x-axis label.
Give it a shot! Scroll down when you're ready for the step-by-step guide.