Skip to content

Instantly share code, notes, and snippets.

View Abusagit's full-sized avatar
🎯

Fedor Velikonivtsev Abusagit

🎯
View GitHub Profile
@Abusagit
Abusagit / normalize_rows.py
Created September 16, 2022 21:55 — forked from f0nzie/normalize_rows.py
Normalize rows of a matrix by dividing rows by the normal of the matrix
def normalizeRows(x):
"""
Implement a function that normalizes each row of the matrix x (to have unit length).
Argument:
x -- A numpy matrix of shape (n, m)
Returns:
x -- The normalized (by row) numpy matrix. You are allowed to modify x.
"""
@Abusagit
Abusagit / read_vcf.py
Created June 4, 2021 15:46 — forked from dceoy/read_vcf.py
[Python] Read VCF (variant call format) as pandas.DataFrame
#!/usr/bin/env python
import io
import os
import pandas as pd
def read_vcf(path):
with open(path, 'r') as f:
lines = [l for l in f if not l.startswith('##')]
@Abusagit
Abusagit / gist:f91eb954667b9657ca8c4a207dc4c690
Created April 4, 2021 14:11 — forked from vladimirtsyupko/gist:10964772
Git force pull to overwrite local files
git fetch --all
git reset --hard origin/master
git pull origin master