This file contains hidden or 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
from bokeh.plotting import figure, output_file, show | |
plot = figure(plot_width=300, plot_height=300) | |
plot.annulus(x=[1, 2, 3], y=[1, 2, 3], color="#7FC97F", | |
inner_radius=0.2, outer_radius=0.5) | |
show(plot) |
This file contains hidden or 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 numpy as np | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
dataset = sns.load_dataset("tips") | |
sns.relplot( | |
data=dataset, | |
x="total_bill", y="tip", col="time", | |
hue="smoker", style="smoker", size="size", | |
) |
This file contains hidden or 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 plotly.graph_objects as go | |
fig = go.figure(data = go.bar(y=[1,2,3])) | |
fig.show() |
This file contains hidden or 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 altair as alt | |
from vega_datasets import data | |
iris = data.iris() | |
# Making the Scatter Plot with altair | |
alt.Chart(iris).mark_point().encode( | |
# defining x-axis | |
x='sepalLength', | |
# defining y-axis | |
y='petalLength', |
This file contains hidden or 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 missingno as msno | |
dataset = pd.read_csv('filename.csv') | |
msno.bar(dataset) |
This file contains hidden or 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 yara | |
rule = yara.compile(source='rule foo: bar {strings: $a = "lmn" condition: $a}') | |
matches = rule.match(data='abcdefgjiklmnoprstuvwxyz') |
This file contains hidden or 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
html_doc = """ | |
<html> | |
<head> | |
<title>Test Page</title> | |
</head> | |
<body> | |
<p><b>This is a test page.</b></p> | |
</body> | |
</html> | |
""" |
This file contains hidden or 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
resp = ur.urlopen("https://thumbor.forbes.com/thumbor/960x0/https%3A%2F%2Fspecials-images.forbesimg.com%2Fdam%2Fimageserve%2F1068867780%2F960x0.jpg%3Ffit%3Dscale") | |
image = np.asarray(bytearray(resp.read()), dtype="uint8") | |
im = cv2.imdecode(image, cv2.IMREAD_COLOR) | |
blur = cv2.GaussianBlur(im, (5,5),0) | |
cv2_imshow(blur) |
This file contains hidden or 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 mahotas | |
import mahotas.demos | |
import numpy as np | |
from pylab import imshow, gray, show | |
from os import path | |
photo = mahotas.demos.load('luispedro', as_grey=True) | |
photo = photo.astype(np.uint8) | |
gray() | |
imshow(photo) | |
show() |
This file contains hidden or 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
#Packages related to general operating system & warnings | |
import os | |
import warnings | |
warnings.filterwarnings('ignore') | |
#Packages related to data importing, manipulation, exploratory data #analysis, data understanding | |
import numpy as np | |
import pandas as pd | |
from pandas import Series, DataFrame | |
from termcolor import colored as cl # text customization | |
#Packages related to data visualizaiton |