This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy as np | |
from sklearn.feature_selection import VarianceThreshold | |
data = pd.DataFrame({'A':[1,0,0,0,0,0,0],'B':[0,1,1,0,1,1,0],'C':[0,0,0,1,1,1,0],'Str1':['l1','l2','l3','l2,l3','l3,l1','l3','l3']}) | |
selector = VarianceThreshold(threshold=(.8 * (1 - .8))) | |
selector.fit(data.select_dtypes(include=[np.number])) | |
data[data.columns[selector.get_support(indices=True)]].join(data.select_dtypes(exclude=[np.number])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dxfgrabber | |
import cv2 | |
import numpy as np | |
import sys | |
""" | |
def absdiff(num1, num2): | |
if num1 <= num2: | |
return num2 - num1 | |
else: |