Skip to content

Instantly share code, notes, and snippets.

@sreekarun
sreekarun / index.md
Created April 6, 2026 23:20
Gist Index

Python & Data Science

SQL (SQLite focus)

@sreekarun
sreekarun / python_zip.md
Created April 5, 2026 17:34
Python ZIP

Python zip() — Real Examples and When to Use It


What is zip()?

# zip pairs up elements from multiple iterables position by position
# and returns an iterator of tuples
@sreekarun
sreekarun / Numpy_matrix.md
Created April 5, 2026 17:26
Numpy multiply and matrix multiplication

NumPy Multiply and Matrix Multiplication


SETUP

import numpy as np

a = np.array([1, 2, 3, 4])
@sreekarun
sreekarun / Numpy_random.md
Created April 5, 2026 17:19
Numpy Random

NumPy Random — default_rng and Random Number Generation


SETUP

import numpy as np

# Modern way — always use this (NumPy 1.17+)
@sreekarun
sreekarun / Numpy_unfunc.md
Last active April 5, 2026 17:03
Numpy Universal Functions

NumPy Universal Functions (ufuncs)


SETUP

import numpy as np

a = np.array([1, 2, 3, 4, 5])
@sreekarun
sreekarun / Numpy_basics.md
Created April 5, 2026 16:26
Numpy - Basic operations

NumPy Basic Number Functions


SETUP

import numpy as np

arr    = np.array([1, 2, 3, 4, 5])
@sreekarun
sreekarun / SQL_cast.md
Created April 5, 2026 16:23
SQL CAST as data type

CAST as Data Type in SQLite


SETUP — Table Used

SELECT * FROM netflix_titles LIMIT 5;
PRAGMA table_info(netflix_titles);
@sreekarun
sreekarun / SQL_minmax.md
Created April 5, 2026 16:21
SQL MIN and MAX

MIN and MAX in SQLite


SETUP — Table Used

SELECT * FROM netflix_titles LIMIT 5;
PRAGMA table_info(netflix_titles);
@sreekarun
sreekarun / SQL_Subqueries.md
Last active April 5, 2026 16:19
SQL - Sub Queries and CTEs

Subqueries and CTEs in SQLite


SETUP — Tables Used

SELECT * FROM netflix_titles    LIMIT 5;
SELECT * FROM netflix_directors LIMIT 5;
SELECT * FROM netflix_reviews LIMIT 5;
@sreekarun
sreekarun / SQL_Groups.md
Created April 5, 2026 16:11
SQL - GROUP BY, ORDER BY, LIMIT, DISTINCT

GROUP BY, ORDER BY, LIMIT, DISTINCT in SQLite


SETUP — Table Used

SELECT * FROM netflix_titles LIMIT 5;
PRAGMA table_info(netflix_titles);