2. Why Python?
• most popular language for Data Scientists worldwide
• Python tops the list of the most popular programming
languages in 2018
• Object-Oriented
• Dynamic Type Checking makes it inherently generic – C++
templates for free!
• Free, as in Open Source free
• Portable
• Powerful language constructs / features
• Powerful toolkit / library
• Mixable with other languages
• Easy to use & learn
7. Popularity
41 large organizations in the world have adopted Python as their primary
programming language in a very small span of time. Some of the big players
like Quora
• Facebook
• YouTube
• SlideShare
• Dropbox
• Pinterest
• Reddit
• Netflix
have most of their new code written in Python.
19. features
1. Open Source
2. Quick to Learn
3. Simple to read and understand
4. Powerful
5. Ubiquitous
6. Object Oriented +Procedural
7. Dynamically Type
8. Strongly Type
9. Wide space delimited [indentation]
10. Interpreted
21. Unbiquitious
1. Web Scripting [Django]
2. 3 D modeling [Blender]
3. Desktop Applications [eg drop box]
4. Games [PyGames]
5. Scientific [PySci]
22. PEP
1. Python Enhance Program
2. Community
3. Guidelines
4. PEP0—Index of PEP
5. PEP1—purpose of PEP
6. PEP8 --style
7. PEP20—design
8. Import shell
23. History
1. Python was conceived in the late 1980s by Guido van Rossum
2. at Centrum Wiskunde & Informatica (CWI) in the Netherlands as a
successor to the ABC language (itself inspired by SETL), capable
of exception handling and interfacing with the Amoeba operating system.
3. Its implementation began in December 1989.
4. 1991 first released
5. Community
6. Van Rossum led the language community until stepping down as leader in
July 2018
7. Python Software Foundation.
24. Python
1. Python 2 /Python 3
2. Python 2 : legacy
3. Python 3 : new and in use
4. ----------------------------------------------------------------------------
5. Python 3.7.2
6. Python 2.7
25. Installation
Important: You want to be sure to check the box that says Add Python 3.x to PATH as shown to
ensure that the interpreter will be placed in your execution path.
Then just click Install Now. That should be all there is to it. A few minutes later you should have a working Python 3 installation on your system.
26. LINUX
Linux
There is a very good chance your Linux distribution has Python installed already, but it probably won’t be
the latest version, and it may be Python 2 instead of Python 3.
To find out what version(s) you have, open a terminal window and try the following commands:
•python --version
•python2 --version
•python3 --version
One or more of these commands should respond with a version, as below:
$ python3 --version Python 3.6.5
If the version shown is Python 2.x.x or a version of Python 3 that is not the latest (3.6.5 as of this writing),
then you will want to install the latest version. The procedure for doing this will depend on the Linux
distribution you are running.
Note that it is frequently easier to use a tool called pyenv to manage multiple Python versions on Linux. To
learn more about it, see our article here.
Ubuntu
27. Depending on the version of the Ubuntu distribution you run, the Python install instructions vary. You can determine your local Ubuntu version by running the
following command:
$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.4 LTS Release: 16.04 Codename: xenial
Depending on the version number you see under Release in the console output, follow the instructions below:
•Ubuntu 17.10, Ubuntu 18.04 (and above) come with Python 3.6 by default. You should be able to invoke it with the command python3.
•Ubuntu 16.10 and 17.04 do not come with Python 3.6 by default, but it is in the Universe repository. You should be able to install it with the following commands:
$ sudo apt-get update $ sudo apt-get install python3.6
You can then invoke it with the command python3.6.
•If you are using Ubuntu 14.04 or 16.04, Python 3.6 is not in the Universe repository, and you need to get it from a Personal Package Archive (PPA). For
example, to install Python from the “deadsnakes” PPA, do the following:
$ sudo add-apt-repository ppa:deadsnakes/ppa $ sudo apt-get update $ sudo apt-get install python3.6
As above, invoke with the command python3.6.
LINUX
45. >>> name=input('What is your name? ‘)
What is your name? Sourabh
>>> name
'Sourabh'
>>> help(input)
Help on built-in function input in module builtins:
input(...)
input([prompt]) -> string
Read a string from standard input. The trailing newline is stripped.
If the user hits EOF (Unix: Ctl-D, Windows: Ctl-Z+Return), raise EOFError.
On Unix, GNU readline is used if enabled. The prompt string, if given,
Concatenation
46. Modules
print("Learning imports and modules")
print(dir())
import math
print(dir())
print("Value of pi ",math.pi)
print("value of tan 1 ",math.tan(1))
del(math)
import math as mymaths
print(dir())
print("Value of pi ",mymaths.pi)
print("value of tan 1 ",mymaths.tan(1))
del(mymaths)
from math import pi,tan
print(dir())
print("Value of pi ",pi)
print("value of tan 1 ",tan(1))
del(pi)
del(tan)
from math import pi as pie,tan as tangent
print(dir())
print("Value of pi ",pie)
print("value of tan 1 ",tangent(1))
del(pie)
del(tangent)
47. Importing module
from math import pi
radius=input("What is the radius of circle? ")
print("Area of the circle",float(radius)**2*pi)
print("Circumference",2*pi*float(radius))
58. #lograthmic and power functions
print("math.log(x)",math.log(x))
print("math.log10(x)",math.log10(x))
print("math.exp(x)",math.exp(x))
print("math.pow(x,x)",math.pow(x,x))
print("math.sqrt(25)",math.sqrt(25))
61. #values considered as False in python
if not None:print("None is False")
if not False:print("False is False")
if not (0 or 0.0 or 0j):print("Zero is False")
if not({} or set([])):print("Empty sequence is False")
#Boolean or returns first true, or last false value
print("True or False returns",True or False)
print("1 or 0 returns",1 or 0)
print("None or 0 returns",None or 0)
62. #Boolean and returns first false or last true value
print("True and False returns",True and False)
print("1 and 0 returns",1 and 0)
print("None and 0 returns",None and 0)
#Boolean Not returns False if operand is True
print("Not True returns",not True)
print("Not 1returns",not 1)
print('Not "Text" returns',not "text")
#Boolean Not returns True if operand is False
print("Not False returns",not False)
print("Not 0 returns ",not 0)
print('Not "" returns',not "")
63. String or str
quote1 ="Welcome to Aimpoint"
quote2 ='Welcome to Aimpoint'
print(quote1,quote2)
quote3 ='Welcome to "Aimpoint"'
quote4 ="Welcome to Aimpoint's Institute"
print(quote3,quote4)
quote5 ="Welcome to "Aimpoint""
quote6='Welcome to Aimpoint's Institute'
print(quote5,quote6)
quote7='Welcome n to n Aimpoint'
print(quote7)
64. quote8='Welcome t to t Aimpoint'
print(quote8)
quote9='How to print '
print(quote9)
quote10=r'Welcome nto nAimpoint'
print(quote10)
quote11=r'Welcome tto tAimpoint'
print(quote11)
quote12=r'Welcome to Aimpoint'
print(quote12)
quote13="Aimpoint"
print("Welcome",quote13)
quote14="Aimpoint"
print("Welcome"+quote14)
print("*"*5)
quote15="Double"
print("LENGTH OF QUOTE",len(quote15))
print("MAX OF QUOTE",max(quote15))
print("MIN OF QUOTE",min(quote15))
65. quote16="Welcome to aimpoint"
print("welcome in quote16 or not ","bhopal" not in
quote16)
print("welcome in quote16 or not ","aimpoint" in quote16)
###string methods
quote17="Welcome to Aimpoint"
print("Count no of e",quote17.count('e'))
print("index of e",quote17.index('e'))
print("index of 0 between 10 15",quote17.index("o",5,12))
print("find l",quote17.find('l'))
print("starts with wel",quote17.startswith("Wel"))
print("ends with point",quote17.endswith("point"))
print("UPPER",quote17.upper())
print("LOWER",quote17.lower())
csv='a,b,c'
print("csv.split(',') returns",csv.split(','))
print("','.join(['x','y','z','w'])",",".join(["x","y","z","w"]))
print("A5e3.isalpha() returns","A533!".isalpha())
print("223.isdigit() returns","223".isdigit())
66. a = "Welcome, Aimpoint"
print(a[1])
print(a[2:5])
b = " Welcome, Aimpoint"
print(b)
print(b.strip())
print(b.replace("t","t!!!"))
67.
68. Have Your Own 3D Model? You Can Import It!
PowerPoint allows you to import a variety of popular 3D
model formats.
So no matter your workflows outside of PowerPoint, you
should be able to find a suitable solution to make your 3D
models portable and presentable to virtually anyone,
anywhere and on any device (with just a few quick
modifications)
To Insert a 3D Model:
1 Go to Insert > 3D Models from a File…
This will open the Insert 3D Model Window where
you can search your computer, network or cloud
drive for any saved 3D models.
2 Insert the 3D model by selecting the file and
clicking on Insert.
The 3D Model will now be placed onto your
PowerPoint slide
69. Two Ways to Position and Rotate Your 3D Model
Try them yourself with the parrot on the right:
1 Click on your 3D Model: Click and
hold on the 3D control to rotate or
tilt your 3D model up, down, left,
and right. 3D Control
2 Alternatively, with your model selected, on the
Ribbon, in the 3D Model Tool Format tab, you can
click on 3D Model Views gallery to apply one of
the various position views.
70. Pan and Zoom
To resize or crop your 3D model within a frame, you can use the pan and zoom tool.
1 Select your 3D model > 3D Models
Format > Pan & Zoom
Note: the Pan & Zoom tool acts like an
on/off (toggle) switch. Once pressed,
you’ll see a gray box around the Pan &
Zoom button to indicate the feature is
activated. Press the button again to
deactivate the Pan & Zoom feature.
2 With the Pan & Zoom button enabled, now
move, rotate, and resize your 3D model.
3 When you are finished editing, click
the Pan & Zoom button again to exit
Pan and Zoom mode.
71. Now Animate Your 3D Model Using the Morph Transition
Try it yourself with the parrot on the right:
1 Duplicate this slide: Right-click the
slide thumbnail and select
Duplicate Slide.
2 In the second of these two
identical slides, change the 3D
Model on the right in some way
(rotate, move, or resize), then go
to Transitions > Morph.
3 Return to the first of the two slides and
press the Slide Show button and then
select Play to see your parrot morph!
72. Animate Your 3D Model Using the Animations Tab
Try it yourself with the parrot on the right:
1 Select the 3D Model on the right, then go to Animations > Turntable
Hint: Effect Options gives you even more options for Turntable.
2 Explore the other new animations designed specifically for 3D models:
Arrive, Swing, Jump & Turn, and Leave.
3 Click Add Animation to combine the new 3D animations with other
classic 2D animations, such as Fade, Grow/Shrink, or one of the many
Motion Path animations to test and see what is possible.
73. More questions about PowerPoint?
Select the Tell Me button and type what you want to know.
SELECT THE ARROW WHEN IN SLIDE SHOW MODE
Visit the PowerPoint team blog
Go to free PowerPoint training
74. Machine Learning
1. Collect a Data Set# Preprocessing data
2. Build your model
3. Train your Model
4. Evaluate your Model
5. Predict