python

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

pip commands for python

pip(Pip Installs Packages): is a command to install various python packages. some of the following pip commands for different packages of python as well as pip upgrade. pip upgrade ———————- python -m pip install –upgrade pip to check pip version ——————————– c:\python34\scripts>pip –version [press enter, shows pip version] to install scipy ———————— c:\python34>pip install scipy …

pip commands for python Read More »

Share
Share
Scroll to Top