”
name : naga sai durga . kota,
roll no : 23me1a04g8,
topic : python.
Introduction to Python
Python is a high-level, interpreted, and general-purpose programming
language. It is known for its simple syntax
KEY FEATURES
Easy to learn and use
Interpreted language
Dynamically typed
Object-oriented and
function
Large standard library
Cross-platform
Variables and Data Types
Variables store data. Python has dynamic typing, so type declaration is
optional.
Numeric
Integers, floats, complex numbers.
Text
Strings are sequences of characters.
Boolean
True or False values.
Collections
Lists, tuples, dictionaries, sets.
Constants in Python
Python doesn't have built-in constants. By convention, uppercase variable names denote constants.
Naming Convention Readability Module Scope
Use all capital letters for constant Indicates values not meant to Often defined at the module level.
variables. change.
Type Casting and Conversion
Convert data from one type to another. This is crucial for many
operations.
Implicit Conversion
Python automatically handles type promotion.
Explicit Casting
Use functions like int(), float(), str().
Conditional Statements and Loops
Control the flow of your programs. Make decisions and repeat actions.
For Loops
Iterate over sequences.
If-Else
Execute code based on conditions.
While Loops
Repeat while a condition is true.
Data Structures: Lists, Tuples, Dictionaries
Python offers powerful built-in data structures for various needs.
Lists
Ordered, mutable collections. Perfect for dynamic data.
Tuples
Ordered, immutable collections. Data integrity is maintained.
Dictionaries
Unordered, mutable key-value pairs. Efficient data retrieval.
Object-Oriented Programming (OOP)
OOP organises software design around objects. It uses concepts like classes, objects, and inheritance.
Polymorphism
1 One interface, multiple forms.
Abstraction
2 Hiding complex implementation details.
Encapsulation
3 Bundling data and methods.
Inheritance
4 Classes inheriting properties.
Classes & Objects
5 Blueprints and instances.
Numpy Basics for Data Science
Numpy is fundamental for numerical computing in Python. It excels at array operations .
Numpy is crucial for numerical operations in Python, especially for large datasets.
It provides efficient array objects.
Array Creation
Create n-dimensional arrays using
np.array().
Import numpy as nparr =
np. Array ([1,2,3])
Array Operations
Array Operations
Perform element-wise operations and mathematical functions.
arr + 2np . Sqrt( arr )
Pandas Basics for Data Science
Pandas is essential for data manipulation and analysis. It introduces DataFrames and Series.
1M+ 100+
Rows Handled Operations
Efficiently processes large
Supports diverse data
datasets.
transformations.
DataFrames are table-like structures. They provide powerful
tools for cleaning, transforming, and analysing data.
• Data cleaning and preparation.
• Data visualisation integration.
• Data exploration and analysis.