🔍 Python Regex in Action! Built a zero-setup SQLite demo that creates healthcare patient data and uses PURE Python regex (re.search) to find all @email.com patterns. No SQL LIKE - strictly Python re module! 👨💻 GITHUB LIVE: https://lnkd.in/gR8xTD98 OUTPUT: Table created with 5 patient records Sample data: ID:1 | John Doe | john.doe@email.com | 123-456-7890 [...] Email pattern test (regex '@.*email\.com$'): John Doe: john.doe@email.com Jane Smith: jane.smith@email.com Sarah Wilson: sarah.w@email.com Bob Lee: bob.lee@email.com 💡 Key learning: re.search(r'@.*email\.com$', email) = SQL LIKE '%@email.com' Run it yourself → python test_regex.py (no pip install needed!) #Python #Regex #SQL #DataEngineering #HealthcareData #Portfolio
Python Regex Demo: Zero-Setup SQLite with Email Pattern Matching
More Relevant Posts
-
#Day 19/ 50daysChallenge #FileHandling 🔥 File Handling: File Handling means reading data from a file and writing data into a file using Python. Example: Saving text, reading notes, storing data, etc. ✅ Open a File: Code file = open("demo.txt", "w") file.close() 👉 "w" = write mode (create file) ✅ Write into a File: Code file = open("demo.txt", "w") file.write("Hello Python") file.close() Output (inside file) Hello Python ✅ Read a File: Code file = open("demo.txt", "r") data = file.read() print(data) file.close() Output Hello Python ✅ Append Data to File: 👉 "a" = append mode Code file = open("demo.txt", "a") file.write("\nWelcome to Python") file.close() Output (inside file) Hello Python Welcome to Python ✅Using with : This automatically closes the file. Code with open("demo.txt", "r") as file: data = file.read() print(data) Output Hello Python Welcome to Python 🎯Task: 👉 Ask user to enter name and store it in a file ✅ Code name = input("Enter your name: ") file = open("student.txt", "w") file.write(name) file.close() print("Name saved in file") ✅ Output Input Enter your name: Durga Output Name saved in file File content (student.txt) Durga #50daysChallenge #pythonBasics #coding #BVCEC #ECE
To view or add a comment, sign in
-
Most Python performance problems I see aren’t about micro-optimizations; they’re about data structure choices. A "common" one: using a `list` for membership checks instead of a `set`. Lists require O(n) scans. Sets use hash tables and give O(1) lookups on average. On large datasets the difference can be huge. If you're interested why, definitely check below.
To view or add a comment, sign in
-
The biggest difference between Python and SQL is not syntax... it’s the mindset. One interesting thing about working with data is this.. Python and SQL don’t just solve problems differently. They make you think differently. When you write SQL, your brain starts thinking in sets. You stop thinking row by row. Instead, you ask questions like: How can I filter this entire dataset? How can I group this information? How can I combine multiple tables together? SQL trains your mind to understand relationships, structure, and patterns in data. Python feels different. With Python, the thinking becomes more step-by-step. You start breaking problems into smaller pieces: read the data clean it transform it build logic around it automate or analyze further Python encourages procedural thinking. That’s why people who know both tools often solve problems faster. SQL helps you ask better questions from data. Python helps you build solutions around those answers. Neither replaces the other. They simply train two different parts of your analytical thinking. And when both ways of thinking start working together, data problems suddenly become much easier to solve. #Python #Sql #DataScience #DataAnalyst
To view or add a comment, sign in
-
Today I practiced two important Pandas concepts for data analysis in Python 📊🐍 🔹 loc vs iloc Both are used for selecting data in a DataFrame. • loc[] → Selects data using labels (column names or index labels) • iloc[] → Selects data using index positions Example: df.loc[0:5, ["Product","Sales"]] df.iloc[0:5, 1:3] 🔹 Data Filtering Filtering helps analysts focus only on relevant records in a dataset. Example: df[df["Sales"] > 1000] Learning how to select and filter data efficiently is a fundamental skill in Data Analytics. Step by step building stronger skills in Python and Pandas. #Python #Pandas #DataAnalytics #LearningJourney
To view or add a comment, sign in
-
🚀 Day 3/60 – Variables & Data Types (The Foundation of Python) If you don’t understand this, Python will feel confusing. If you master this, everything becomes easy. Let’s break it down 👇 🧠 What is a Variable? A variable is like a container that stores data. Example 👇 name = "Adeel" age = 25 Here: • name stores text • age stores a number 🔢 Python Data Types (Most Important Ones) 1️⃣ String (Text) name = "Adeel" 2️⃣ Integer (Whole Number) age = 25 3️⃣ Float (Decimal Number) price = 99.99 4️⃣ Boolean (True/False) is_active = True 🧪 Let’s Print Them print(name) print(age) print(price) print(is_active) ⚡ Pro Tip (Very Important) Python is dynamically typed 👉 You don’t need to declare data types x = 10 x = "Now I am text" Same variable. Different type. ❌ Common Beginner Mistake name = Adeel # ❌ Error Correct way: name = "Adeel" # ✅ Always use quotes for text. 🔥 Challenge for today Create 4 variables: • Your name • Your age • Your favorite number • Are you learning Python? (True/False) Then print all of them. Comment “DONE” when finished ✅ Follow Adeel Sajjad if you’re serious about learning Python in 60 days 🚀 #Python #LearnPython #PythonProgramming #Coding #Programming
To view or add a comment, sign in
-
-
Let us look at the keyword “FROM” in SQL and Python. Sometimes the same word can exist in different environments but serve completely different purposes. Take “FROM” for an example. ● In Python, from is commonly used when importing modules, libraries, or specific functions into your notebook or script. Example: from pandas import DataFrame Here, Python is bringing tools into your workspace so you can perform tasks like data manipulation, analysis, or visualization. ● In SQL, FROM plays a different role. Example: SELECT column_name FROM table_name Here, SQL is specifying where the data is coming from, the table that holds the dataset you want to query. So even though the keyword is the same, the purpose is different. ● In Python, from helps you import tools. ●In SQL, FROM helps you retrieve data from a source. Same keyword. Different environments. Different responsibilities. This reminded me of something beyond tech. Sometimes we compare ourselves with others and wonder why our results look different. Why someone is doing something one way and we are doing it another way. However, like SQL and Python, we may be operating in different environments with different purposes. ● SQL doesn’t compete with Python. ● Python doesn’t compete with SQL. They simply perform different roles in the data ecosystem. So if today you feel like your journey looks different from someone else’s, remember this: You might just be operating in a different environment, and that is perfectly okay. Your uniqueness is part of your design. #DataAnalytics #SQL #Python #TechLearning #WomenInTech #ContinuousLearning #DataJourney #TechMotivation
To view or add a comment, sign in
-
-
🔥 Python is not just a language. It’s a universe. Everyone talks about Pandas, NumPy, FastAPI… But real Python power? It lives in the modules most people IGNORE. 👀 Today I went deep into Python internals and explored: abc | aifc | argparse And honestly? 🤯 Mind = Blown 🧠 1️⃣ abc – Abstract Base Classes Define rules before implementation. Think like an architect, not a coder from abc import ABC, abstractmethod class DataPipeline(ABC): @abstractmethod def process(self): pass class ETL(DataPipeline): def process(self): return "Processing Data..." 👉 Forces structure. Clean design. Enterprise mindset. 🎧 2️⃣ aifc – Audio File Handling Yes, Python can read AIFF audio files. import aifc with aifc.open('sample.aiff', 'r') as f: print(f.getnchannels()) Not common. But powerful in media processing. 🛠 3️⃣ argparse – Build CLI Tools Like a Pro import argparse parser = argparse.ArgumentParser() parser.add_argument("--name") args = parser.parse_args() python app.py --name Kartik Boom 💥 Instant CLI tool. #Python #AsyncIO #BackendEngineering #CleanCode #100DaysOfCode #DataEngineering #TechLeadership
To view or add a comment, sign in
-
I cleaned a 568,700-row dataset in 8 lines of Python. A client sent me a csv file. But the data was messy with duplicate rows, missing values, inconsistent date formats and column names with spaces. Instead of fixing everything manually, I used Python. import pandas as pd df=pd.read_csv('client_messy_data.csv') df.columns =df.columns.str.strip().str.lower().str.replace(' ', '_') df.drop_duplicates(inplace=True) df['revenue'] =pd.to_numeric(df['revenue'], errors='coerce') df['date'] =pd.to_datetime(df['date'], errors='coerce') df.dropna(subset=['customer_id','revenue','date'], inplace=True) df.to_csv('client_clean_data.csv', index=False) 8 lines of code gave me a clean dataset. One thing I’ve learned is cleaning the data is most of the work. If you master this skill, you become extremely valuable on any data team. What's the messiest dataset you had to deal with? and what challenged you most? #Python #Pandas #DataCleaning #DataAnalysis
To view or add a comment, sign in
-
I’ve been using DuckDB a lot lately for doing analyses, and one thing I kept running into was how messy SQL can get once it’s scattered across scripts. So I built a small python library called QuackSQL to help organize queries in .sql files and load them as simple reusable functions. Nothing fancy. Just a cleaner way to keep analytical SQL reusable and organized. I wrote a short post about it here: https://lnkd.in/gRvRCXsQ
To view or add a comment, sign in
-
🧠 Python Concept That Makes Objects Behave Like Dictionaries: __getitem__ You can make your own objects work with [] indexing 👀 🤔 The Surprise Normally: data = [10, 20, 30] print(data[1]) # 20 But you can enable the same behavior in your own class. 🧪 Example class Book: def __init__(self): self.pages = ["Intro", "Chapter 1", "Chapter 2"] def __getitem__(self, index): return self.pages[index] b = Book() print(b[0]) # Intro print(b[1]) # Chapter 1 Now your object behaves like a list 🎯 🧒 Simple Explanation 📖 Imagine a book 📖 When someone asks for page 2, the librarian opens the book and gives it. 📖 That librarian = __getitem__. 💡 Why This Is Powerful ✔ Custom containers ✔ Database record access ✔ Pandas / NumPy behavior ✔ Clean APIs ⚡ Fun Fact These operators map to methods: obj[x] → __getitem__ obj[x]=y → __setitem__ del obj[x] → __delitem__ 🐍 In Python, [ ] isn’t just for lists. 🐍 Any object can support indexing 🐍 __getitem__ is the hook behind it. #Python #PythonTips #PythonTricks #AdvancedPython #CleanCode #LearnPython #Programming #DeveloperLife #DailyCoding #100DaysOfCode
To view or add a comment, sign in
-
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development