Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

AIES Assignment1

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 15

Introduction to Python Basics

By: Mihir Sutawane (16033923007)


What is Python?
• It is a High-level, interpreted programming language.
• It was created by Guido van Rossum, released in 1991.
• It emphasizes readability and simplicity.
• Python is an interpreted language, which means that code is executed
line by line, making it easy to test and debug. It also supports an
interactive mode, allowing users to experiment with code snippets.
• Python comes with packages for various tasks, such as file I/O,
networking, regular expressions, and more. This reduces the need for
external libraries in many cases.
Python Syntax
1. Indentation-based coding.
2. No curly braces or semicolons.
Example:
#Hello World program
print("Hello, World!")
Variables and Data Types:
3. Dynamically typed variables.
4. Common data types: int, float, str, bool.
Uses of Python
1. Extensive standard library.
2. Rich third-party libraries (NumPy, Pandas, Django, etc.).
3. Widely used in data science, web development, automation, AI and
more.
4. Python, along with libraries like Tkinter, PyQt, and Kivy, is used to
create desktop GUI applications.
5. Python is a dominant language in the field of machine learning and
artificial intelligence. Frameworks like TensorFlow, PyTorch, and
scikit-learn enable the development and deployment of machine
learning models.
Python ToolKits
• In Python, toolkits are libraries or collections of modules that provide
pre-built functions and classes to facilitate specific tasks or solve
particular problems. These toolkits cover a wide range of domains,
from web development to data science, machine learning, and more.
• Python toolkits can be thought of as sets of tools that extend the
capabilities of the Python programming language. They are often
created to address specific needs or to provide efficient solutions to
common challenges in different fields.
• These toolkits are essential for developers as they allow them to
leverage existing code and functionalities, saving time and effort in the
development process.
Numpy

• Numpy is a general-purpose array-processing package. It


provides a high-performance multidimensional array object, and
tools for working with these arrays.
• Besides its obvious scientific uses, Numpy can also be used as
an efficient multi-dimensional container of generic data.
• NumPy is a fundamental library for scientific computing in
Python and serves as a foundation for many other libraries and
frameworks in the data science and machine learning
ecosystems.
• N-dimensional Arrays: NumPy introduces a new data structure called ‘ndarray
‘(n-dimensional array), which is a fast and flexible container for large datasets.
These arrays can be one-dimensional, two-dimensional, or even higher-
dimensional.
• Linear Algebra Operations: NumPy includes a comprehensive set of linear
algebra operations, such as matrix multiplication, decomposition, and solving
linear equations. These functionalities are crucial in various scientific and
engineering applications.
• Indexing and Slicing: NumPy provides powerful indexing and slicing
capabilities, allowing users to access and manipulate specific elements or
subsets of arrays efficiently.
• Integration with Other Libraries: NumPy is often used in conjunction with other
libraries, such as Pandas for data manipulation, Matplotlib for data visualization,
and Scikit-learn for machine learning.
Pandas
• Pandas is a powerful and widely-used open-source data manipulation
and analysis library for Python.
• Pandas is particularly well-suited for working with structured data
and is an essential tool in the toolkit of data scientists, analysts, and
engineers.
• It is built on the top of the NumPy library which means that a lot of
structures of NumPy are used or replicated in Pandas.
• Well suited for working with tabular data, such as spreadsheets or
SQL tables.
• DataFrame: The DataFrame is a two-dimensional, labeled data
structure with columns that can be of different types (e.g., integers,
floats, strings). It is similar to a spreadsheet or SQL table, making it
convenient for handling and analyzing structured data.
• Data Cleaning: Pandas provides functions for handling missing data,
removing duplicates, and transforming data. This is crucial for
preparing data for analysis.
• Data Exploration: Users can easily explore and summarize data using
descriptive statistics, aggregations, and visualization tools. Pandas
integrates well with other visualization libraries like Matplotlib and
Seaborn.
• Data Selection and Indexing: Pandas allows for flexible and powerful
indexing and selection of data based on labels, positions, or boolean
conditions. This makes it easy to filter and subset data.
• GroupBy Operations: Pandas supports grouping data based on one or
more keys and performing operations on each group independently.
This is useful for aggregating and summarizing data.
• Merging and Joining: Pandas provides functions to merge and join
DataFrames based on common columns or indices, similar to SQL
operations.
• Time Series Functionality: Pandas has robust support for working
with time series data, including date/time indexing, resampling, and
time-based calculations.
Matplotlib
• Matplotlib is a comprehensive 2D plotting library for Python that
enables users to create a wide range of high-quality static
visualizations.
• Matplotlib is widely used in various scientific disciplines, data
analysis, and engineering for creating plots and charts to visualize
data and present results.
• Matplotlib consists of several plots like line, bar, scatter, histogram,
etc.
Some of the sample plots are covered here.
Seaborn

• Seaborn is a visualization library for statistical graphics plotting in


Python.
• It provides beautiful default styles and color palettes to make statistical
plots more attractive.
• It is built on top matplotlib library and is also closely integrated with
the data structures from pandas.
• Seaborn aims to make visualization the central part of exploring and
understanding data.
• It provides dataset-oriented APIs so that we can switch between
different visual representations for the same variables for a better
understanding of the dataset.
1. Statistical Plotting: Seaborn includes several functions for creating
statistical plots that are not easily achievable with Matplotlib alone.
2. Attractive Aesthetics: Seaborn comes with visually appealing default
styles and color palettes.
3. Built-in Themes and Color Palettes: Seaborn provides various built-
in themes and color palettes, allowing users to quickly change the
overall appearance of their plots.
4. Support for Categorical Data: Seaborn excels at handling categorical
data, making it easy to create plots that display relationships between
variables, especially when one or more variables are categorical.
5. Facet Grids: Seaborn supports facet grids, which allow users to
create a grid of subplots based on the values of one or more
variables.
THANK YOU

You might also like