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
df_conf.drop(['Province/State','Lat', 'Long'],axis=1, inplace=True) | |
df_c=pd.DataFrame(columns=df_conf.columns) | |
df_c['Country/Region']=country_list | |
for col_name in df_c.keys()[1:]: | |
for ctry in country_list: | |
x=df_conf[col_name][df_conf["Country/Region"]==ctry].sum() | |
df_c[col_name][df_c['Country/Region']==ctry]=x | |
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
currancy_dict={'USD':'Dollar', | |
'EUR':'Euro', | |
'GBP':'Pound', | |
'INR':'Rupee'} |
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
plt.figure(figsize=(12,8)) | |
#Scatterplot | |
sns.scatterplot(data=hdi_df, x='gni_pc', y='life_ex') | |
#Title | |
plt.title(f"G 20 Countries : {abbr['gni_pc']} vs {abbr['life_ex']}") | |
# x and y axis labels | |
plt.xlabel(abbr['gni_pc']) |
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 matplotlib.pyplot as plt | |
a=[1,2,3,4] | |
b=[4,8,7,3] | |
def plotter(s): | |
plt.figure() | |
plt.style.use(s) | |
plt.plot(a,b) | |
plt.title(s) | |
plt.show() |
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 yfinance as yf | |
aapl=yf.Ticker('aapl') | |
aapl.quarterly_balance_sheet | |
#aapl.balancesheet |
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
def img2sketch(photo, k_size): | |
#Read Image | |
img=cv2.imread(photo) | |
# Convert to Grey Image | |
grey_img=cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) | |
# Invert Image | |
invert_img=cv2.bitwise_not(grey_img) | |
#invert_img=255-grey_img |
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
def photo2pixelart(image, i_size, o_size): | |
""" | |
image: path to image file | |
i_size: size of the small image eg:(8,8) | |
o_size: output size eg:(10000,10000) | |
""" | |
#read file | |
img=Image.open(image) | |
#convert to small image |
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 Libraries | |
from PIL import Image | |
from PIL.ExifTags import TAGS | |
# Open Image | |
img=Image.open('img.jpg') | |
#Get EXIF Data | |
exif_table={} | |
for k, v in img.getexif().items(): |