r/learnpython • u/Ok_Step1507 • 6d ago
Need feedback
I made my first big python project as a beginner high school student. It visualizes CO2 emission trends and compares with countries and compares gdp, population and other stuff. It uses matplotlib, numpy, seaborn, streamlit and pandas.
link: https://github.com/rapanjeetsingh/python-project
4
Upvotes
1
u/ad1tya_24 3d ago
Took a look through your repo and the live Streamlit app. For a first big project in high school, this is genuinely really well done.
Using u/st
.cache_dataon your data loader right out of the gate was smart. The most common mistake beginners make with Streamlit is letting the script re-read multiple CSVs from disk every time someone touches a slider or dropdown. Also good catch rememberingplt.close(fig)afterst.pyplot()—a lot of people forget that and run into memory leaks over long sessions.A couple of small things you could tweak if you want to make it even cleaner:
app.py,pd.read_csv(filename)relies on your terminal running from the exact project folder. If you runstreamlit runfrom an outer directory or import it elsewhere, it will throw aFileNotFoundError. A common pattern to prevent that is:plotly.express(px.line) andst.plotly_chart. Having interactive hover tooltips so someone can see the exact number for a specific year makes comparing countries a lot nicer.Really clean work on the UI and data cleaning. Definitely keep at it.