Skip to content

Instantly share code, notes, and snippets.

dr-alberto /
Created November 28, 2020 21:58
Check the linear depencency of two vectors using Numpy
import numpy as np
from scipy.linalg import lu
def linearly_dependent(x, y):
if len(x) == 2 and len(y) == 2:
matrix = np.array([x, y]).T
return np.linalg.det(matrix) == 0.0
matrix = np.array([x, y])
_, u = lu(matrix, permute_l=True)
def readmail(volume):
m = imaplib.IMAP4_SSL("")
m.login(user, pwd)'"[Gmail]/All Mail"')
resp, items =,
"NOT SEEN FROM tradingview")
items = items[0].split()
for emailid in items:
resp, data = m.fetch(emailid,