SlideShare a Scribd company logo
1 of 18
Python with Data Sciences
By - Krishna Mohan Mishra
Reg.No.-11605503
Introduction
• Python is a Object Oriented programming and scripting
language.
• It was created by Guido van Rossum.
• It first appeared on 20 February 1991.
Features :
*Platform independent * fewer lines of code
*Interpreted language *code reusability
Applications:
*YouTube
*Google Search Engine
*Dropbox
Python Types
Strings:
• Strings are ordered blocks of text
• Written inside quotes(both single and double quotes can be used
Ex- str1=”Calibri”
-str2=‘Calibri'
Operators , Methods & Testing Conditions
Python Types
Lists:
• Lists are ordered mutable sequences
• Heterogeneous array
For ex- list1=[10,20,”john”]
Python Types
Sets:
Sets are unordered mutable sequences
of unique elements.
Tuples:
Tuples are unordered immutable sequences .
Dictionary
• Unordered mutable collection of mapping obj
• Values accessed by keys
• Heterogenous
• Can be nested
• Can vary in size
• Modifiable in place
• Hash table for efficiency
• Both dictionary and lists are heterogeneous ,
can contain any python types.
Functions
• A function is created with def keyword
• The statements in the block must be indented
• The def keyword is followed by the function
name with round brackets and a colon
• The indented statements form body of a
function
For ex :
Built in functions:
Files
• File Handling is very important concept of
Python.
• File is used to save the data permanently
on disk.
• File has specific name and directory path.
• File operations are read, write and search.
READ
Files
WRITE :
SEARCH :
Classes & Objects
Class − A user-defined prototype for an object that defines a set of attributes.
The class statement creates a new class definition.
 The self parameter is the reference to the class itself, and it is used to access the
variables that belong to the class.
 All classes have a function called __init__(), which is always executed when the class
is being initiated
Exception Handling
• An exception is an event , which
occurs during the execution of
program that stops normal flow of
the program’s instructions
• When Python script raises exception it
must either handled or terminate.
• Exception are handled using the try
and except keywords.
Example:
1.
2.
Regular Expressions
• Specialized programming language embedded in
python
• Based on rules definition , and applying to a string
• Useful for complex pattern matching
Steps :
1. Submit a regex string
2. Compile the string to get a regex byte code
3. Apply the compiled regex byte code to target string
4. Obtain the result of the match
5. Use the results.
Metacharacters : A metacharacter is a character that
has a special meaning to a computer program such as a
regular expression engine.
Regular ExpressionsMethods:
1. re.match(pattern, string)-finds match if it occurs at start of the string.
Ex- import re
result=re.match(r’AV’, ‘AV Analytics Vidhya AV’)
print(result.group(0))
2. re.search(pattern, string)-finds match at any place in the string
3. re.findall(pattern,string)-list of all matching patterns
4. re.split(pattern,string,maxsplit=0)-splits string by occurrence of given pattern
Ex- result=re.split(r’y’ , ‘Analytics’)
print(result) # o/p – [‘Anal’ , ’tics’]
5. re.sub(pattern,repl,string)-search and replace
Ex- re.sub(r’India’ , ‘the World’ , ‘AV is largest Analytics community of India’)
print(result)
o/p- AV is largest Analytics community of the World
Regular Expressions
Examples:
1. Extract all characters after “@”
2. Return date from given string
Web Scraping
 pip (Pip Installs Packages)- a package manager for python ,that that can help to
expand the module list that we have with the standard installation.
install- pip install <package name>
list of installed package- pip list
uninstall- pip uninstall <package name>
 Web Scrapping- To extract content from the web and process it to create useable
data and analytics for wide spectrum of applications.
At the core of it the process is to download a web page , and parse its html content
to extract areas of interest .this is then converted to a data form for further analysis
and presentation.
Web Scraping
 Retrieving web pages using “urllib.request”
 Web Scraping using BeautifulSoup package.
Web Scraping
 Opening Web browser
Python with data Sciences

More Related Content

What's hot

Introduction to Python
Introduction to Python Introduction to Python
Introduction to Python amiable_indian
 
CLTL presentation: training an opinion mining system from KAF files using CRF
CLTL presentation: training an opinion mining system from KAF files using CRFCLTL presentation: training an opinion mining system from KAF files using CRF
CLTL presentation: training an opinion mining system from KAF files using CRFRubén Izquierdo Beviá
 
KafNafParserPy: a python library for parsing/creating KAF and NAF files
KafNafParserPy: a python library for parsing/creating KAF and NAF filesKafNafParserPy: a python library for parsing/creating KAF and NAF files
KafNafParserPy: a python library for parsing/creating KAF and NAF filesRubén Izquierdo Beviá
 
Python 3 Programming Language
Python 3 Programming LanguagePython 3 Programming Language
Python 3 Programming LanguageTahani Al-Manie
 
Fundamentals of Python Programming
Fundamentals of Python ProgrammingFundamentals of Python Programming
Fundamentals of Python ProgrammingKamal Acharya
 
Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3Chariza Pladin
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to pythonYi-Fan Chu
 
Introduction To Programming with Python-3
Introduction To Programming with Python-3Introduction To Programming with Python-3
Introduction To Programming with Python-3Syed Farjad Zia Zaidi
 
11 Unit 1 Chapter 02 Python Fundamentals
11  Unit 1 Chapter 02 Python Fundamentals11  Unit 1 Chapter 02 Python Fundamentals
11 Unit 1 Chapter 02 Python FundamentalsPraveen M Jigajinni
 
Binary Studio Academy PRO: ANTLR course by Alexander Vasiltsov (lesson 3)
Binary Studio Academy PRO: ANTLR course by Alexander Vasiltsov (lesson 3)Binary Studio Academy PRO: ANTLR course by Alexander Vasiltsov (lesson 3)
Binary Studio Academy PRO: ANTLR course by Alexander Vasiltsov (lesson 3)Binary Studio
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answersRojaPriya
 

What's hot (20)

Python Tutorial Part 1
Python Tutorial Part 1Python Tutorial Part 1
Python Tutorial Part 1
 
Python_basics.pptx
Python_basics.pptxPython_basics.pptx
Python_basics.pptx
 
Python Data-Types
Python Data-TypesPython Data-Types
Python Data-Types
 
Introduction to Python
Introduction to Python Introduction to Python
Introduction to Python
 
CLTL presentation: training an opinion mining system from KAF files using CRF
CLTL presentation: training an opinion mining system from KAF files using CRFCLTL presentation: training an opinion mining system from KAF files using CRF
CLTL presentation: training an opinion mining system from KAF files using CRF
 
KafNafParserPy: a python library for parsing/creating KAF and NAF files
KafNafParserPy: a python library for parsing/creating KAF and NAF filesKafNafParserPy: a python library for parsing/creating KAF and NAF files
KafNafParserPy: a python library for parsing/creating KAF and NAF files
 
Python 3 Programming Language
Python 3 Programming LanguagePython 3 Programming Language
Python 3 Programming Language
 
Fundamentals of Python Programming
Fundamentals of Python ProgrammingFundamentals of Python Programming
Fundamentals of Python Programming
 
What is Python?
What is Python?What is Python?
What is Python?
 
Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3Zero to Hero - Introduction to Python3
Zero to Hero - Introduction to Python3
 
Data types in python
Data types in pythonData types in python
Data types in python
 
Introduction to python
Introduction to pythonIntroduction to python
Introduction to python
 
Python training
Python trainingPython training
Python training
 
Introduction To Programming with Python-3
Introduction To Programming with Python-3Introduction To Programming with Python-3
Introduction To Programming with Python-3
 
11 Unit 1 Chapter 02 Python Fundamentals
11  Unit 1 Chapter 02 Python Fundamentals11  Unit 1 Chapter 02 Python Fundamentals
11 Unit 1 Chapter 02 Python Fundamentals
 
Python made easy
Python made easy Python made easy
Python made easy
 
Binary Studio Academy PRO: ANTLR course by Alexander Vasiltsov (lesson 3)
Binary Studio Academy PRO: ANTLR course by Alexander Vasiltsov (lesson 3)Binary Studio Academy PRO: ANTLR course by Alexander Vasiltsov (lesson 3)
Binary Studio Academy PRO: ANTLR course by Alexander Vasiltsov (lesson 3)
 
Python Session - 2
Python Session - 2Python Session - 2
Python Session - 2
 
Python ppt
Python pptPython ppt
Python ppt
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answers
 

Similar to Python with data Sciences

PPT on Python - illustrating Python for BBA, B.Tech
PPT on Python - illustrating Python for BBA, B.TechPPT on Python - illustrating Python for BBA, B.Tech
PPT on Python - illustrating Python for BBA, B.Techssuser2678ab
 
Programming in Python
Programming in Python Programming in Python
Programming in Python Tiji Thomas
 
Python presentation of Government Engineering College Aurangabad, Bihar
Python presentation of Government Engineering College Aurangabad, BiharPython presentation of Government Engineering College Aurangabad, Bihar
Python presentation of Government Engineering College Aurangabad, BiharUttamKumar617567
 
Python for katana
Python for katanaPython for katana
Python for katanakedar nath
 
Python indroduction
Python indroductionPython indroduction
Python indroductionFEG
 
web programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Malothweb programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh MalothBhavsingh Maloth
 
manish python.pptx
manish python.pptxmanish python.pptx
manish python.pptxssuser92d141
 
pysdasdasdsadsadsadsadsadsadasdasdthon1.ppt
pysdasdasdsadsadsadsadsadsadasdasdthon1.pptpysdasdasdsadsadsadsadsadsadasdasdthon1.ppt
pysdasdasdsadsadsadsadsadsadasdasdthon1.pptkashifmajeedjanjua
 

Similar to Python with data Sciences (20)

Python ppt
Python pptPython ppt
Python ppt
 
Python
PythonPython
Python
 
PPT on Python - illustrating Python for BBA, B.Tech
PPT on Python - illustrating Python for BBA, B.TechPPT on Python - illustrating Python for BBA, B.Tech
PPT on Python - illustrating Python for BBA, B.Tech
 
Programming in Python
Programming in Python Programming in Python
Programming in Python
 
Pa2 session 1
Pa2 session 1Pa2 session 1
Pa2 session 1
 
Kavitha_python.ppt
Kavitha_python.pptKavitha_python.ppt
Kavitha_python.ppt
 
Python presentation of Government Engineering College Aurangabad, Bihar
Python presentation of Government Engineering College Aurangabad, BiharPython presentation of Government Engineering College Aurangabad, Bihar
Python presentation of Government Engineering College Aurangabad, Bihar
 
Python for katana
Python for katanaPython for katana
Python for katana
 
Python indroduction
Python indroductionPython indroduction
Python indroduction
 
web programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Malothweb programming UNIT VIII python by Bhavsingh Maloth
web programming UNIT VIII python by Bhavsingh Maloth
 
intro to python.pptx
intro to python.pptxintro to python.pptx
intro to python.pptx
 
manish python.pptx
manish python.pptxmanish python.pptx
manish python.pptx
 
ENGLISH PYTHON.ppt
ENGLISH PYTHON.pptENGLISH PYTHON.ppt
ENGLISH PYTHON.ppt
 
python1.ppt
python1.pptpython1.ppt
python1.ppt
 
python1.ppt
python1.pptpython1.ppt
python1.ppt
 
Python Basics
Python BasicsPython Basics
Python Basics
 
python1.ppt
python1.pptpython1.ppt
python1.ppt
 
Lenguaje Python
Lenguaje PythonLenguaje Python
Lenguaje Python
 
pysdasdasdsadsadsadsadsadsadasdasdthon1.ppt
pysdasdasdsadsadsadsadsadsadasdasdthon1.pptpysdasdasdsadsadsadsadsadsadasdasdthon1.ppt
pysdasdasdsadsadsadsadsadsadasdasdthon1.ppt
 
coolstuff.ppt
coolstuff.pptcoolstuff.ppt
coolstuff.ppt
 

More from Krishna Mohan Mishra (20)

PDF automation
PDF automationPDF automation
PDF automation
 
Excel automation
Excel automationExcel automation
Excel automation
 
Database automation
Database automationDatabase automation
Database automation
 
Bot creator- RPA
Bot creator- RPABot creator- RPA
Bot creator- RPA
 
Bot insight
Bot insightBot insight
Bot insight
 
Automation Anywhere Clients
Automation Anywhere ClientsAutomation Anywhere Clients
Automation Anywhere Clients
 
Metabot
MetabotMetabot
Metabot
 
Web Control Room-2
Web Control Room-2Web Control Room-2
Web Control Room-2
 
Web Control Room
Web Control RoomWeb Control Room
Web Control Room
 
IQ BoT
IQ BoTIQ BoT
IQ BoT
 
bot story
bot storybot story
bot story
 
Introduction to RPA
Introduction to RPAIntroduction to RPA
Introduction to RPA
 
IBM Study material
IBM Study materialIBM Study material
IBM Study material
 
Data structures college notes(LPU)
Data structures college notes(LPU)Data structures college notes(LPU)
Data structures college notes(LPU)
 
Performance issues in Cloud Computing
Performance issues in Cloud ComputingPerformance issues in Cloud Computing
Performance issues in Cloud Computing
 
Teaching Assistant Evaluation
Teaching Assistant EvaluationTeaching Assistant Evaluation
Teaching Assistant Evaluation
 
Stock Market Prediction Using ANN
Stock Market Prediction Using ANNStock Market Prediction Using ANN
Stock Market Prediction Using ANN
 
Software requirement Analysis (SRS) for FACEBOOK
Software requirement Analysis (SRS) for FACEBOOKSoftware requirement Analysis (SRS) for FACEBOOK
Software requirement Analysis (SRS) for FACEBOOK
 
Os basic
Os basicOs basic
Os basic
 
Gantt and PERT chart
Gantt and PERT chartGantt and PERT chart
Gantt and PERT chart
 

Recently uploaded

HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxbritheesh05
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort servicejennyeacort
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learningmisbanausheenparvam
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxvipinkmenon1
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 

Recently uploaded (20)

HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
Artificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptxArtificial-Intelligence-in-Electronics (K).pptx
Artificial-Intelligence-in-Electronics (K).pptx
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort serviceGurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
Gurgaon ✡️9711147426✨Call In girls Gurgaon Sector 51 escort service
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
chaitra-1.pptx fake news detection using machine learning
chaitra-1.pptx  fake news detection using machine learningchaitra-1.pptx  fake news detection using machine learning
chaitra-1.pptx fake news detection using machine learning
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Introduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptxIntroduction to Microprocesso programming and interfacing.pptx
Introduction to Microprocesso programming and interfacing.pptx
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 

Python with data Sciences

  • 1. Python with Data Sciences By - Krishna Mohan Mishra Reg.No.-11605503
  • 2. Introduction • Python is a Object Oriented programming and scripting language. • It was created by Guido van Rossum. • It first appeared on 20 February 1991. Features : *Platform independent * fewer lines of code *Interpreted language *code reusability Applications: *YouTube *Google Search Engine *Dropbox
  • 3. Python Types Strings: • Strings are ordered blocks of text • Written inside quotes(both single and double quotes can be used Ex- str1=”Calibri” -str2=‘Calibri' Operators , Methods & Testing Conditions
  • 4. Python Types Lists: • Lists are ordered mutable sequences • Heterogeneous array For ex- list1=[10,20,”john”]
  • 5. Python Types Sets: Sets are unordered mutable sequences of unique elements. Tuples: Tuples are unordered immutable sequences .
  • 6. Dictionary • Unordered mutable collection of mapping obj • Values accessed by keys • Heterogenous • Can be nested • Can vary in size • Modifiable in place • Hash table for efficiency • Both dictionary and lists are heterogeneous , can contain any python types.
  • 7. Functions • A function is created with def keyword • The statements in the block must be indented • The def keyword is followed by the function name with round brackets and a colon • The indented statements form body of a function For ex : Built in functions:
  • 8. Files • File Handling is very important concept of Python. • File is used to save the data permanently on disk. • File has specific name and directory path. • File operations are read, write and search. READ
  • 10. Classes & Objects Class − A user-defined prototype for an object that defines a set of attributes. The class statement creates a new class definition.  The self parameter is the reference to the class itself, and it is used to access the variables that belong to the class.  All classes have a function called __init__(), which is always executed when the class is being initiated
  • 11. Exception Handling • An exception is an event , which occurs during the execution of program that stops normal flow of the program’s instructions • When Python script raises exception it must either handled or terminate. • Exception are handled using the try and except keywords. Example: 1. 2.
  • 12. Regular Expressions • Specialized programming language embedded in python • Based on rules definition , and applying to a string • Useful for complex pattern matching Steps : 1. Submit a regex string 2. Compile the string to get a regex byte code 3. Apply the compiled regex byte code to target string 4. Obtain the result of the match 5. Use the results. Metacharacters : A metacharacter is a character that has a special meaning to a computer program such as a regular expression engine.
  • 13. Regular ExpressionsMethods: 1. re.match(pattern, string)-finds match if it occurs at start of the string. Ex- import re result=re.match(r’AV’, ‘AV Analytics Vidhya AV’) print(result.group(0)) 2. re.search(pattern, string)-finds match at any place in the string 3. re.findall(pattern,string)-list of all matching patterns 4. re.split(pattern,string,maxsplit=0)-splits string by occurrence of given pattern Ex- result=re.split(r’y’ , ‘Analytics’) print(result) # o/p – [‘Anal’ , ’tics’] 5. re.sub(pattern,repl,string)-search and replace Ex- re.sub(r’India’ , ‘the World’ , ‘AV is largest Analytics community of India’) print(result) o/p- AV is largest Analytics community of the World
  • 14. Regular Expressions Examples: 1. Extract all characters after “@” 2. Return date from given string
  • 15. Web Scraping  pip (Pip Installs Packages)- a package manager for python ,that that can help to expand the module list that we have with the standard installation. install- pip install <package name> list of installed package- pip list uninstall- pip uninstall <package name>  Web Scrapping- To extract content from the web and process it to create useable data and analytics for wide spectrum of applications. At the core of it the process is to download a web page , and parse its html content to extract areas of interest .this is then converted to a data form for further analysis and presentation.
  • 16. Web Scraping  Retrieving web pages using “urllib.request”  Web Scraping using BeautifulSoup package.