Skip to content

Instantly share code, notes, and snippets.

View zjplab's full-sized avatar
🏠
Working from home

JP Zhang zjplab

🏠
Working from home
View GitHub Profile
@vasanthk
vasanthk / System Design.md
Last active May 24, 2024 06:19
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@fnielsen
fnielsen / mixedindexing.py
Last active November 16, 2019 04:00
Mixed indexing with integer index in Pandas DataFrame
import pandas as pd
df = pd.DataFrame([[1, 2, 's'], [3, 4, 't'], [4, 5, 'u']],
index=[-1, 0, 1], columns=['a', 'b', 'c'])
>>> df.a # Correct type
-1 1
0 3
1 4
Name: a, dtype: int64
@arasharchor
arasharchor / knn.py
Created June 28, 2015 11:47
k nearest neighbor classifier
import numpy as np
class KNearestNeighbor:
""" a kNN classifier with L2 distance """
def __init__(self):
pass
def train(self, X, y):
"""