Skip to content

Instantly share code, notes, and snippets.

View letthedataconfess's full-sized avatar
🎯
Focusing

Let The Data Confess letthedataconfess

🎯
Focusing
View GitHub Profile
@letthedataconfess
letthedataconfess / image_conversion.py
Last active September 19, 2021 09:22
opencv part 1
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
cv2.imshow('zebra',gray)
cv2.waitKey(0)
cv2.destroyAllWindows()
@letthedataconfess
letthedataconfess / Imagewriting.py
Last active September 19, 2021 08:03
opencv part 1
cv2.imwrite('zebra.png',img)
@letthedataconfess
letthedataconfess / image display 2
Created September 19, 2021 07:12
opencv part 1
plt.figure(figsize = (30,6))
plt.imshow(img)
@letthedataconfess
letthedataconfess / Display the image
Created September 19, 2021 07:08
opencv part 1
cv2.imshow('zebra',img)
cv2.waitKey(0)
cv2.destroyAllWindows()
@letthedataconfess
letthedataconfess / Image reading.py
Last active September 19, 2021 09:18
opencv part 1
img = cv2.imread('Zebra.jpg')
plt.figure(figsize = (10,6))
plt.imshow(img)
!pip install opencv-python
@letthedataconfess
letthedataconfess / interquartlie range
Created February 1, 2021 16:32
outlier_detection
dataset=[11,10,12,14,12,15,14,13,15,102,12,14,17,19,107,10,13,12,14,12,108,12,11,14,13,15,10,15,12,10,14,13,15,10]
dataset=sorted(dataset)
q1, q3= np.percentile(dataset,[25,75])
iqr = q3 - q1
lower_bound = q1 -(1.5 * iqr)
upper_bound = q3 +(1.5 * iqr)
print('lower_bound={},upper_bound={}'.format(lower_bound,upper_bound))
outliers_pt=[]
@letthedataconfess
letthedataconfess / Z score
Created February 1, 2021 16:24
outlier detection
import numpy as np
outliers=[]
dataset=[11,10,12,14,12,15,14,13,15,102,12,14,17,19,107,10,13,12,14,12,108,12,11,14,13,15,10,15,12,10,14,13,15,10]
def detect_outliers(data):
threshold=3
mean=np.mean(data)
std=np.std(data)
for i in dataset:
@letthedataconfess
letthedataconfess / boxplot
Created February 1, 2021 16:20
outlier detection
import matplotlib.pyplot as plt
data =[20,25,27,75,40,67,62,75,78,71,32,82,127,140,78,67,132,82,87,66,56,52]
plt.boxplot(data,vert=False)
plt.show()
@letthedataconfess
letthedataconfess / scatter plot
Created February 1, 2021 16:13
Outlier detection
import matplotlib.pyplot as plt
x = [5,7,8,10,3,17,4,9,7,9,8,9,6]
y = [40,36,47,48,120,46,67,48,31,134,50,35,56]
plt.scatter(x, y)
plt.show()