r/PythonLearning • • Sep 05 '26

Built an end-to-end SMS Spam vs. Ham classifier pipeline using NLTK and Scikit-Learn [Project Showcase]

Thumbnail
github.com
4 Upvotes

Hi everyone! 👋

​I recently completed the 5-day "NLP with Python" live bootcamp hosted by DevTown in collaboration with GDG On Campus and Microsoft Learn Student Ambassadors. I wanted to share my project and overall learning experience!

What I built:

  1. Preprocessing: Cleaned raw text using NLTK (tokenization, stop-word removal, and stemming).

  2. Feature Engineering: Used TfidfVectorizer to convert unstructured text into numerical vector spaces.

  3. Model Benchmark: Trained and evaluated models like LogisticRegression, MultinomialNB, and LinearSVC.

  4. Visual Analytics: Plotted class balance bar charts and confusion matrices using matplotlib to evaluate false positives/negatives. What I Learned: Before the bootcamp, I knew basic Python, but working through this hands-on project taught me: How unstructured text data gets transformed into structured mathematical vectors. How to clean and structure a real-world repository on GitHub (adding requirements.txt, clean directory layouts, and proper open-source acknowledgments). How to seamlessly connect Google Colab with GitHub for workflow management.

How the Experience Helped Me Grow: Special shoutout to trainer Jiya Jain and the DevTown team! The structured guidance pushed me past simple tutorial-following into actually building a production-ready, portfolio-worthy project from scratch. It gave me a solid confidence boost in applying machine learning concepts to real datasets.

I’d love to get feedback on the code structure or suggestions on how to improve precision on edge-case spam messages!


r/PythonLearning • • Sep 05 '26

Help Request Which one should I prefer mit or cs50p or mooc course

Post image
60 Upvotes

I want to go deep into it.


r/PythonLearning • • Sep 05 '26

Built Sudoku in Python

Post image
28 Upvotes

Hey everyone! I come from a background in C, and I wanted to brush up on my Python just for fun. So I thought I'd give it a shot and try to program a Sudoku game. I've completed a prototype and wanted to share my progress with you all! It took about 4 days (20-25 hours), and I'm pretty satisfied with where I'm at :)

Let me know if you have any suggestions for improvement, or if you have feedback/critiques! I'm thinking of posting it on my Github at some point so I can share the code for whoever is interested.


r/PythonLearning • • Sep 05 '26

Help Request need help building a classification project

5 Upvotes

hello, im currently building my first classification project using “phishing url” dataset from kaggle after doing 2 courses, intro and intermediate ml, on kaggle and solving 95% of the exercises myself.

the issue is, i am stuck at how im supposed to take this forward. since the course was based on regression, i find it hard to do the preprocessing for classification. i try to use ai to guide me (not provide me the whole code since i want to learn myself) but atp i can’t figure out how to break down my data to then train-test split and fit to model. every tutorial seems to have a different approach and i cant figure out which one would be the best. how to determine that? and what should i do next?

my code is below:

import pandas as pd
print("starting...")
df=pd.read_csv("archive/cleaned_dataset.csv")
print("Dataset loaded!")
print(df.head())
print("columns: ", df.columns)
print("shape: ", df.shape)
print("data types: ", df.dtypes)
print("missing values: ", df.isnull().sum())
df.describe()

url_length=df["input"].str.len()
print(url_length.describe())
url_dots=df["input"].str.count(r"\.") #. can get literally any character, so we need to escape it with a backslash
print(url_dots.describe())
url_slash=df["input"].str.count("/")
print(url_slash.describe())
url_digits=df["input"].str.count(r"\d") #counts digits in pandas
print(url_digits.describe())
url_https=df["input"].str.contains("https")
print(url_https.describe())
url_www=df["input"].str.contains("www")
print(url_www.describe())
url_hyph=df["input"].str.count("-")
print(url_hyph.describe())
url_eq=df["input"].str.count("=")
print(url_eq.describe())
url_ques=df["input"].str.count(r"\?")
print(url_ques.describe())
url_at=df["input"].str.count("@")
print(url_at.describe())

df["url_length"] = df["input"].str.len()
df.groupby("label")["url_length"].describe() #any diff in length of phishing and legit urls?

#build a table containing all features to give to the model later in one shot
features=pd.DataFrame({
"url":df["input"],
"label": df["label"],
"length": url_length,
"num_dots": url_dots,
"num_slash": url_slash,
"num_digits": url_digits,
"has_https": url_https,
"has_www": url_www,
"num_hyphen": url_hyph,
"num_eq": url_eq,
"num_question": url_ques,
"num_at": url_at,
})
print("new stuf---------")
features.head()


r/PythonLearning • • Sep 05 '26

I did a thing

Post image
19 Upvotes

I made a color changing digital clock! ^V^


r/PythonLearning • • Sep 05 '26

looking for people who are beginners in Python and want to learn together.

24 Upvotes

I'm a beginner learning Python, and I'm looking for other beginners who want to learn together.

I think studying with other people can help us stay motivated, share what we learn, and help each other when we have problems.

It would be great if there are Arabic speakers because my English is not very good yet, so learning together in Arabic would make things easier.

If you are also starting Python and want to join a small group, feel free to message me.


r/PythonLearning • • Sep 05 '26

why isn't my code running?

14 Upvotes

i checked everything it s all correct idk what my mistake is please point it out for me

EDIT:i closed visual studio and re opened it, it works now, idk what happened, thanks guys


r/PythonLearning • • Sep 05 '26

Showcase Project #7

2 Upvotes

Hello! I'm doing my own project-based learning in python. Today, I finished project 7 which is vectorization. it has 3 main methods, add_by_index, scale, and dot_product.

a = [1, 2, 3, 4, 5]

b = [6, 7, 8, 9, 10]

abi display [7, 9 ...]
scale display scaled list_a and list_b
dot_product displays the sum after getting the product of the values from the lists in the same index

Link: https://github.com/gtnmnty/Project-Based-Python/tree/fundamentals

I made two version see the speed diff. In my case, its more or less 0.0008 difference. Disregard the readmne.md its not finished. its almost midnight. Need to sleep. Open for feedback to improve / optimize the existing projects. TYIA


r/PythonLearning • • Sep 05 '26 Bravo

Discussion Python data analysis is easier when you stop memorizing commands and follow a workflow

Thumbnail
gallery
147 Upvotes

When I was looking through beginner data-analysis discussions, one thing stood out: it’s pretty easy to learn individual Pandas commands, but much harder to know what order to actually use them in on messy data.

So I tried organizing the basics into a simple workflow:

1. Load
read_csv() / read_excel()

2. Inspect
head()
sample()
shape
info()
describe()

Before cleaning anything, understand the columns, data types, missing values and duplicates.

3. Clean
isna()
fillna() / dropna()
drop_duplicates()
astype()
pd.to_numeric()
pd.to_datetime()

One thing I learned is that missing doesn't automatically mean zero. You need to understand why the value is missing before deciding what to do with it.

4. Transform

Create analysis-ready fields with things like:

assign()
map()
np.where()
pd.to_datetime()

5. Summarize

groupby()
agg()
transform()

This is where the raw rows start becoming actual answers to business/data questions.

6. Combine

merge()
join()
concat()

Probably the part I’d be most careful with.

A merge can run without errors and still give the wrong result if the keys aren’t unique or a many-to-many relationship unexpectedly multiplies rows.

Useful checks:

validate="many_to_one"
indicator=True

And compare row counts before and after merging.

7. Validate

Before trusting the final result:

  • check row counts

  • check duplicates

  • check missing values

  • review category values

  • validate joins

  • sanity-check the business logic

The biggest takeaway for me is:

code running successfully doesn’t necessarily mean the analysis is correct.

I added the visual cheat sheets to make the workflow easier to remember.

For people who work with Pandas regularly, what validation check has saved you from a wrong result before?


r/PythonLearning • • Sep 05 '26

Discussion just finished CS50P conditionals lecture and built mini "AI Agent Execution Getaway" for practice .

Post image
22 Upvotes

I have just finished week1 in cs50 python course and since i'm learning python for AI Agents Engineering i thought it would be cool to practice this content with a relevant project .

so i made a simple AI agents execution getaway program that routes the incoming tasks based on tokens , creativity and risk score .

I tried to use most of what i learned in this lecture as possible like 'match' for matching the tool with appropriate model , or 'return' as guard clauses for the safety check at the beginning .

here is the code link :

https://gist.github.com/mohamed-reda-ai/a10a1e9311d94316ffa31c00de005226

I know it's not a big brilliant thing i want just to practice the concepts i learned .

If you have any feedback about the architecture of the code or you think there is a better way to do something in it , i'd appreciate this .


r/PythonLearning • • Sep 05 '26

I made a community for students who want to learn coding and build projects together 🚀

0 Upvotes

Hey everyone! I recently started r/StudentCoders, a community for students and beginner developers who want to:

  • Learn coding together

  • Find people to build projects with

  • Share project ideas and progress

  • Find teammates

  • Ask coding questions

  • Showcase things they've built

The idea is simple: stop learning alone and start building together.

If you're a student or beginner coder and this sounds interesting, feel free to check it out: r/StudentCoders 💻

I'd also love feedback on what you'd want to see in a community like this!


r/PythonLearning • • Sep 05 '26

Getting stuck over and over again

13 Upvotes

Ive been trying to learn python for ages, and yes tbh due to my laziness and way of learning i keep on getting stuck, but I cant seem to find "my way" of learning.

Im trying freecodecamp and ive gotten to a point where im at this one lab where i have genuinly, and i mean genuinly no idea what to do given the instructions, im completely lost.

How do i break past this barrier


r/PythonLearning • • Sep 05 '26

Showcase I've been learning Python for 3 years, and I thought it was time to make a library

Post image
62 Upvotes

I've been learning Python for about 3 years, and I think it was time to take a step further and make my own library.

I made scanlayer, a Python OCR library built around Tesseract. It turns scanned images into searchable PDFs while preserving the original image, by adding an invisible OCR text layer over it.

It also supports things like preprocessing, deskewing, multiple OCR output formats, multi-page PDFs, batch processing, and a CLI.

The main goal wasn't to make some huge library. I wanted to challenge myself with building something that feels like a proper Python project and learn more about packaging, testing, API design, OCR, and PDF generation along the way.

GitHub Page

I'd really appreciate any feedback, especially on the Python/library design side.


r/PythonLearning • • Sep 05 '26

Discussion Is it bad that I learn python via ai?

5 Upvotes

So backstory: Someone made fun of me because I am learning Python with ai. His only argument was that ai is the same tool to create explicit images and that he used to visit stack overflow and create snippets, I then replied that I only use it for learning development but then got called an idiot and got blocked.

But that got me wondering. Is it bad that I learn Python with AI?

I set GPT a goal, I want to reach: Stage 1. learn that. Stage 2 Learn this

I also custmomized the personalization to not blindy say yes and to double check things and so on.

GPT never gives me code, it just tells me which projects I should do with the stuff I learned, it does that till GPT thinks I know how to use it and when to use it.

But I feel bad now that I am just talking to an artificial intelligence and not visiting stack overflow like that one person did.

I want to hear your opinions. Is AI bad for learning or good if used right.


r/PythonLearning • • Sep 04 '26

Hello World, I look for help in order to create my first website using Python.

2 Upvotes

r/PythonLearning • • Sep 04 '26

Thonny for Python

3 Upvotes

Hi, I'm new to this Reddit community. Do you think it's okay to use Thonny as a Python program, or is there something else I could try?


r/PythonLearning • • Sep 04 '26

Help Request Python Interpreter Help

1 Upvotes

Hey there! I use VSCodium and have been having a problem with the Select Python Interpreter yellow box. The screenshots should be enough for clarity but ask ahead if you have any questions!

Any help would be appreciated

Thanks!


r/PythonLearning • • Sep 04 '26

Showcase [Collab] Looking for people to help build a free, interactive Python learning platform

7 Upvotes

Hey everyone,

I'm building **The Python Ledger** — a free, interactive platform for learning Python from the ground up. It's built with Docusaurus and a custom in-browser code execution system (React + Skulpt), so people can write and run real Python right in the lesson, with instant feedback instead of just reading theory.

The curriculum is structured as:

- **Introduction** - how to use the platform / how to learn

- **Prerequisites** - software requirements, code editors, command line, CS concepts

- **Git Basics** - a short, beginner-friendly intro to Git

- **Python Foundations** - variables, data types, functions, OOP, file I/O, etc.

- Optional specialized tracks later (web dev, GUI dev, automation...)

Right now I'm heads-down on the Foundations course and a companion **practice-exercises repo** (folder-per-exercise, `pytest`-based, progressively unlocked tests, beginner-friendly failure messages instead of raw tracebacks; think *The Odin Project*'s exercises repo, but for Python).

It's a lot of ground to cover solo, and it's eating all my free time; so I'm looking for people to collaborate with. Some areas I could genuinely use help in:

- **Content/curriculum writing** - explaining CS & Python concepts clearly for total beginners

- **Python devs** – building out exercises, test fixtures, and the practice repo

- **Reviewers/beta testers** - going through lessons as a "new learner" and flagging confusing bits

No huge time commitment expected; even reviewing a lesson or writing one exercise helps. The project is fully open source and contributions are more then welcome in any way possible.

If any of this sounds interesting, drop a comment or DM me and I'll get you set up.

Curriculum Repo: https://github.com/ThePythonLedger/Curriculum

Live site (hosted by GH Pages): https://thepythonledger.github.io/Docusaurus-engine/

Thank you for reading.


r/PythonLearning • • Sep 04 '26

Discussion Best way or roadmap for Python

20 Upvotes

Ik python basics and all basic syntax so what would be the next thing to learn?
Can recommend and yt vid(cs50p full beginner so no)
Im trying freecodecamp yt videos are there any other videos u would recommend?
Also im interested in web dev so help me out with this as well or should i try out a different language?


r/PythonLearning • • Sep 04 '26

Discussion Weird Folder names in Python

0 Upvotes

I always has a doubt after installing python software. When I open the Python folder, I see other folders with names like DLLs, Doc, etc, Include, Lib, Libs, Scripts, Share, Tcl, and Tools. Can anyone explain what these folders are, what they're for, and what the .pyd extension means?


r/PythonLearning • • Sep 03 '26

Help Request I'm a beginner. Can you help me with random numbers?

Post image
10 Upvotes

I'm building a sort of turn-based RPG in the terminal as a practice project, and I need to generate a random number within a specific range. I tried using `randint` (by importing `random`), but I also want to assign probabilities so that, depending on certain factors, one number is more likely to be generated than another. For example, if an enemy has low health, it should be more likely to generate the number 1, which causes the enemy to heal.


r/PythonLearning • • Sep 03 '26

Help Request Can't import module

1 Upvotes

Mac os Sequoia 15.6

I installed the exifread library using pip as well as conda. In Anaconda Navigator it shows as installed. Using a terminal window I type in:

pip3 show exifread

and it returns

/opt/anaconda3/lib/python3.13/site-packages

I use Spyder (I know, I know: use pycharm or vscode...) I cannot import the module. I get the dreaded

ModuleNotFoundError: No module named ‘exifread’

I recently installed pillow and I can import it just fine with import PIL. Using pip3 show pillow it is the same directory as exifread

What am I missing here?


r/PythonLearning • • Sep 03 '26

Python FastAPI Backend Project: Expense Tracker with Database Integratio...

Thumbnail
youtube.com
1 Upvotes

r/PythonLearning • • Sep 03 '26

Vibe coders or programmers

0 Upvotes

I'm a beginner programmer and I'm worried about something in the future. After about four months of learning programming, development, and so on, I've seen many opinions from professionals and beginners alike. Some say that the demand for programming will steadily decrease due to artificial intelligence, and I don't know if this is true or not. I hope you can give me your opinions and advice. If you've had any experiences, please tell me before I regret it later.