Artificial Intelligence

Text extracting from an Image (OCR )

Extract text from an image. Extracting text from an image using pytesseract tool and package using Python programming. install tesseract.exe from here. First, here is an image which contains some text as following..[saved as sample.jpg) And here is the full code to extract text from above image. from PIL import Image #Python Imaging Library (abbreviated …

Text extracting from an Image (OCR ) Read More »

Share

Joins using Python and MySQL

MYSQL Joins with Python Inner join example to retrieve records from two table. Here are those two table: Now we will retrieve records from both tables based on regno column. Source code is:  # pip install mysql-connector import mysql.connector as sql # pip install pandas import pandas as pd db_connection = sql.connect(host=’localhost’, database=’college_db’, user=’root’, password=”) …

Joins using Python and MySQL Read More »

Share

Python and MySQL

Database connectivity using Python In this article we’ll be covering all database examples like SELECT, INSERT, UPDATE and DELETE operations using Python and MySQL database. First,, create database[college_db] and table[student_info] as per following image and insert few records  [here we using wamp server]  before you execute all programs in Python. a) SELECT operation # pip …

Python and MySQL Read More »

Share

Data Science – 4 [extract gold price using web scrap]

Extract live gold price using web scrap – Data Science in the following example we used three packages, they are a) bs4 [Beautiful Soup for web scraping] b) pandas [panel data for data representation ] c) request [to get source / url] #data science with Python – extracting Gold Price import bs4 import pandas as …

Data Science – 4 [extract gold price using web scrap] Read More »

Share

Data Science – 3 [web scraping]

Retrieve current temperature using BeautifulSoup #extract current temp import requests import bs4 #url=”https://weather.com/en-IN/weather/today/l/12.96,77.59?par=google&temp=c” url=”https://weather.com/en-IN/weather/today/l/17.31,76.81?par=google&temp=c” r=requests.get(url) soup=bs4.BeautifulSoup(r.text, “html.parser”) val= soup.find(‘span’, “data-testid=’TemperatureValue'”, class_=’CurrentConditions–tempValue–3KcTQ’) print(“Current temp is : “, val.text) Output of the above program is : Current temp is : 30° 2. To check live price, title and ratings of particular product #data science with Python – …

Data Science – 3 [web scraping] Read More »

Share

Data Science – 2 [web scraping]

Data science with using Python In the following example we will be retrieving live population records using BeautifulSoup package.[web scraping] Live Population record #data science with Python – world’s population stat import bs4 import pandas as pd import requests url = ‘https://www.worldometers.info/world-population/#:~:text=Population%20in%20the%20world%20is,it%20was%20at%20around%202%25.’ result = requests.get(url) soup = bs4.BeautifulSoup(result.text,’lxml’) pop = soup.find_all(‘table’ ,class_= ‘table table-striped table-bordered …

Data Science – 2 [web scraping] Read More »

Share

Data Science – 1 [web scraping]

Data science Data science: is the field of study that combines domain expertise, programming skills, and knowledge of mathematics and statistics to extract meaningful insights from ocean of data. Web scraping can be a solution to speed up the data collection process. Instead of looking at the job site every day, you can use Python …

Data Science – 1 [web scraping] Read More »

Share

Multilevel, Hierarchical and Hybrid Inheritance

Multilevel, Hierarchical and Hybrid Inheritance Multi-Level Inheritance in Python #Multilevel Inheritance in Python class India: def first(self): print (‘India is the largest democratic country in the world’) class Karnataka(India): def sec(self): print (‘Karnataka is famous for IT and Coffee Production’) class Bengaluru(Karnataka): def third(self): print (‘Bengaluru also known as Garden city!’) b=Bengaluru() b.first() b.sec() b.third() …

Multilevel, Hierarchical and Hybrid Inheritance Read More »

Share

Single and Multiple inheritance in Python

Single and Multiple inheritance in Python 1.  Single Inheritance  # Single Inheritance in Python with Student and Marks Details #-Base class class std_per_det: regno = input(“Enter RegNo:”) name = input(“Enter Name:”) course = input(“Enter Course:”) #Base class Method def show_std(self): print(‘Base Class value:’,self.regno) print(‘Base Class value:’,self.name) print(‘Base Class value:’,self.course) #-Derived class class marks_det(std_per_det): p=int(input(“Enter Physics …

Single and Multiple inheritance in Python Read More »

Share
Share
Scroll to Top