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 cv2 | |
face_cascade = cv2.CascadeClassifier("haarcascade_frontalface_default.xml") | |
img=cv2.imread("news.jpg") | |
gray_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY) | |
faces = face_cascade.detectMultiScale(gray_img, scaleFactor=1.1,minNeighbors=5) |
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
from pandas_datareader import data | |
import datetime | |
from bokeh.plotting import figure, show, output_file | |
x | |
start = datetime.datetime(2016,11,1) | |
end = datetime.datetime(2017,2,10) | |
df = data.DataReader(name="GOOG", data_source="google", start=start, end=end) | |
#date_increase = df.index[df.Close > df.Open] | |
#date_decrease = df.index[df.Close < df.Open] |
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 requests | |
from bs4 import BeautifulSoup as bc | |
l =[] #List | |
base_url = "http://www.pythonhow.com/real-estate/rock-springs-wy/LCWYROCKSPRINGS/" | |
r = requests.get(base_url) | |
c = r.content | |
soup = bc(c, "html.parser") |
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 cv2, time | |
#1. Create an object. Zero for external camera | |
video=cv2.VideoCapture(0) | |
#7. Play the video (Indenting) | |
#8. a variable | |
a=0 |
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 cv2, glob #glob module - find path names of files | |
#1. Create a list of files that has extension of JPG | |
images=glob.glob("*.jpg") | |
for image in images: | |
#Read images path | |
img=cv2.imread(image,1) | |
#Create a variable where we will store resized 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
from tkinter import * | |
import backend | |
def get_selected_row(event): | |
global selected_tuple | |
index=list1.curselection()[0] | |
selected_tuple=list1.get(index) | |
e1.delete(0,END) | |
e1.insert(END,selected_tuple[1]) | |
e2.delete(0,END) |
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 | |
from bokeh.plotting import figure, output_file, show | |
df=pandas.read_excel("http://pythonhow.com/verlegenhuken.xlsx",sheetname=0) | |
df["Temperature"]=df["Temperature"]/10 | |
df["Pressure"]=df["Pressure"]/10 | |
p=figure(plot_width=500,plot_height=400) |
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 time | |
from datetime import datetime as dt | |
#Host to temporary file | |
host_temp="hosts" | |
#Host to original path file | |
hosts_path=r"C:\Windows\System32\drivers\etc\hosts" | |
redirect="127.0.0.1" | |
website_list=["www.facebook.com", "facebook.com"] |
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 folium, pandas | |
df=pandas.read_csv("Volcanoes_USA.txt") | |
map=folium.Map(location=[df['LAT'].mean(),df['LON'].mean()],zoom_start=6, tiles='Mapbox bright') | |
def color(elev): | |
minimum=int(min(df['ELEV'])) | |
step=int((max(df['ELEV'])-min(df['ELEV']))/3) | |
if elev in range(minimum,minimum+step): |
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, os | |
os.listdir() | |
df1=pandas.read_csv('supermarkets.csv') | |
import geopy | |
dir(geopy) | |
from geopy.geocoders import Nominatim |
OlderNewer