Notes5

Mon 30 June 2025
# Topic: Basics
name = 'Fahd'
print(f'Hello, {name}')
# Topic: Dictionaries & Sets
d = {'name': 'Fahd', 'age': 20}
print(d.get('name'))
# Topic: Basic ML
from sklearn.linear_model import LinearRegression
model = LinearRegression()
print(model)
# Topic: Basics
x = 10
y = 20
print(x + y)
# Topic: Data Cleaning
import pandas as pd
df = pd …

Category: basics

Read More

Notesi

Mon 30 June 2025
# Topic: Decorators
def log(func):
 def wrapper():
  print('Call')
  func()
 return wrapper
@log
def say(): print('Hi')
say()
# Topic: Data Cleaning
import pandas as pd
df = pd.DataFrame({'A':[1,None,3]})
df = df.fillna(0)
print(df)
# Topic: Algorithms
# Bubble sort
def bubble(arr):
 for i in range(len …

Category: basics

Read More

Notesj

Mon 30 June 2025
# Topic: Data Cleaning
import pandas as pd
df = pd.DataFrame({'A':[1,None,3]})
df = df.fillna(0)
print(df)
# Topic: File I/O
with open('test.txt', 'r') as f:
    print(f.read())
# Topic: OOP
class Student:
    def __init__(self, name): self.name = name
s = Student('Fahd')
print(s …

Category: basics

Read More

Notestoday

Mon 30 June 2025
# Cell 1 — Topic: Data Cleaning
import pandas as pd
df = pd.DataFrame({'A':[1,None,3]})
df = df.fillna(0)
print(df)
# Cell 2 — Topic: Web Scraping
import requests
from bs4 import BeautifulSoup
r = requests.get('https://example.com')
soup = BeautifulSoup(r.text, 'html.parser')
print(soup.title.text)
# Cell …

Category: basics

Read More

Panda

Mon 30 June 2025
import pandas as pd
df = pd.DataFrame({'Name': ['Alice', 'Bob', 'Charlie'], 'Age': [25, 30, 35]})
print(df)
      Name  Age
0    Alice   25
1      Bob   30
2  Charlie   35
df['Name_Upper'] = df['Name'].str.upper()  # Now works because 'Name' exists
print(df)
      Name  Age Name_Upper
0    Alice   25      ALICE
1      Bob …

Category: basics

Read More

Proper1

Mon 30 June 2025
# Cell 1 — Topic: Regex
import re
text = 'email: test@example.com'
print(re.findall(r'\S+@\S+', text))
# Cell 2 — Topic: Recursion
def fact(n): return 1 if n==0 else n*fact(n-1)
print(fact(5))
# Cell 3 — Topic: Matplotlib & Seaborn
import seaborn as sns
import pandas as pd …

Category: basics

Read More

Proper2

Mon 30 June 2025
# Cell 1  Topic: Decorators
def log(func):
 def wrapper():
  print('Call')
  func()
 return wrapper
@log
def say(): print('Hi')
say()
# Cell 2  Topic: Mini Projects
# Palindrome check
def is_pal(s): return s == s[::-1]
print(is_pal('madam'))
# Cell 3 — Topic: Pandas
import pandas as pd
df = pd.DataFrame({'A':[1 …

Category: basics

Read More

Pynotes Advanced 1

Mon 30 June 2025
# Topic: Basics
x = 7
print('Odd' if x % 2 else 'Even')
# Topic: Functions
def factorial(n):
    return 1 if n==0 else n * factorial(n-1)
print(factorial(5))
# Topic: Decorators
def decorator(fn):
    def wrapper():
        print('Before')
        fn()
        print('After')
    return wrapper
@decorator
def say(): print('Hi')
say()
# Topic: Pandas …

Category: basics

Read More

Pynotes Advanced 2

Mon 30 June 2025
# Topic: Recursion
def fib(n):
    if n <= 1: return n
    return fib(n-1) + fib(n-2)
print(fib(5))
# Topic: Web Scraping
import requests
from bs4 import BeautifulSoup
r = requests.get('https://example.com')
soup = BeautifulSoup(r.text, 'html.parser')
print(soup.title.string)
# Topic: Loops
i = 0
while …

Category: basics

Read More

Python01

Mon 30 June 2025
# Topic: Lists & Tuples
nums = [1,2,3]
nums.append(4)
print(nums)
# Topic: Web Scraping
import requests
from bs4 import BeautifulSoup
r = requests.get('https://example.com')
soup = BeautifulSoup(r.text, 'html.parser')
print(soup.title.string)
# Topic: NumPy
import numpy as np
a = np.array([1,2,3])
print …

Category: basics

Read More
Page 3 of 5

« Prev Next »