Python
Python
Python
– Basics of python
– Loops in Python
– Functions
• Environment Setup
– Tools Installation?
• https://www.python.org/downloads
You can open command prompt You can open Anaconda prompt
directly type following to install directly type following to start
Jupyter notebook : Jupyter notebook :
• Object Oriented
Python is a general-purpose
programming language that is often
applied in scripting roles
• Interpreted language
• Open Source
• Extensible
• Cross-platform language
More user-friendly
More applications
Stability
Speed
• https://www.python.org/downloads
1
Copyright © 2022 TalentLabs Limited
2
Jupyter Installation & Usage
You can open command prompt directly You can open Anaconda prompt
type following to install Jupyter directly type following to start Jupyter
notebook : notebook :
1
Copyright © 2022 TalentLabs Limited
4
Basics o f Python
– def, – from,
– class, – lambda,
– continue, – except,
– break, – import,
– finally, – None
• With the help of type() function you can check the type of variable used.
Datatype
Immutable Mutable
• Operator : -, +, /,*,**
1 Conditional statements
3 Transfer statements
01 02 03 04
Syntax Example
if condition: number = 6
statement 1 if number > 5:
statement 2 print('/talentlabs')
statement n
Syntax Example
Syntax Example
Example
1 Break Statement.
3 Pass Statement.
Example
Example
Example
For loop
for i in range(0,5):
print(i)
else:
print("for loop completely exhausted, since there is no break.");
While Loop
• Here, name of function is type and expression in • Int can convert floating-point values to integers
parenthesis is called argument of the function. and vice-versa
• int(3.4545)
• 3
Numpy vectorize
1 Map function
List comprehension
Plain "for-loop"
x y x y x y x y
Natural join Full outer join Left outer join Right outer join
Concat
frames = [df1, df2]
result = pd.concat(frames)
Bar Graph
Scatter Plot
Histogram
• A histogram is a graph
showing frequency
distributions.
Scatter Plot
Box Plot
Point Plot
Voilin Plot
plt.plot(Convert)
plt.show()