Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
8 views

Python

Uploaded by

Balaji Raja
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Python

Uploaded by

Balaji Raja
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 30

Anaconda (Installation)

Jupyter Notebook – data analytics


Web-based interactive computing notebook environment. Edit & run human readable docs while
describing the data analytics
Click Launch Button
After this, Select Notebook from the NEW drop down menu
After this, Select Python 3 kernel in it
Environment for executing python codes

This is called CELL., where u will be typing the python codes.


Shift + Enter to add new cells Or Click + icon
Click Scissors icon to delete cells
Explain all the icons at the end of the cell (& its functionalities)
Explain File Menu
Features of Python:

2x & 3x versions (We are using 3x versions & usability of 2x versions have declined slowly)
In compilation, U wont get the errors line – by – line.
In Interpretation, u can get the errors line – by – line. Advantage: U can correct it instantly
While explaining all icons, the keyboard icon is to know shortcut keys
Number & Operators : Integers, floating points.
Ctrl + Enter to execute the code or Run button at the top to execute the code
Explain order of precedence using braces
Variables:
Rules for creating variables: No numbers, no space, no keywords
Dynamic typing:
No need of defining variables
Automatic assumption of data types

Strings:
“” or ‘’
String Operations:
String Methods:

Immutability:
Once the string is created, it cannot be replaced
String Formatting:

Lists:
Unlike Strings, Lists are mutable, i.e. it can be replaced
Not necessary to be a same data type.
List Methods:
Tuples:
Similar to strings they are immutable (i.e cannot be replaced), no straight braces mandatory use both.

Dictionaries:

In Python, a dictionary is a built-in data type used to store collections of items. Unlike
sequences like lists or tuples, which store elements in an ordered manner and are accessed
by numerical indices, dictionaries store elements as key-value pairs. Each key in a dictionary
must be unique, and it is associated with a corresponding value.
Methods of Dictionaries:

Nested dictionaries

Sets & Booleans:


A set is an unordered collection of unique elements in Python. Sets are mutable, meaning
you can add or remove elements from them, but they cannot contain duplicate elements.
You can create a set using curly braces {} or the set() function. Here's a basic example:

Sets are unordered collection of unique elements. Similar to dictionaries, but only unique
elements.

Example

Booleans (True / False)

Statements:

If, else & elif


For Loop:
While Loop:

Functions:

Decorators:

In Python, decorators are a powerful feature that allows you to modify or enhance the
behavior of functions or methods without changing their actual code. They are essentially
functions themselves that wrap around other functions, allowing you to add functionality
before or after the wrapped function executes.
Generators:

Objects & Classes:

All data types are objects

Creating own object using class


U cannot show the class without assingning an obkect

Attributes:

Module 4 Python Packages:


Standard packages:

Tensorflow

Numpy -,data analytics


Pandas – Data Handling

Pytorch – At to Tensorflow (FB working -ML, Neural Networks0

OpenCV – Image Processing

Beautiful Soup – Data Scraping

Tkinter – GUI interface app

Pillow – Image Processing

MATplotlib – Data Visualization

Textblob – Natural Language Processing (Sentiment Analysis)

Python Package Index:

https://pypi.org/

Python module Index:

https://docs.python.org/3/py-modindex.html

Import & Instal Packages:

CMD.exe Prompt

Click Launch Button

In that black screen, type pip list to get package lists

& type pip show <package name>

Instaling Python packages using Anaconda

Excel Data Set: Explain functionalities of data analysis using Python.

Codes are needed to do analysis.


With Pandas framework, we can do the same thing with few codes.

Process of cleaning the data: Data wrangling

Data Frame: Data structure that represents data with rows & columns (Tabular structure)
Different ways of creating dataframe:
https://pandas.pydata.org/docs/user_guide/io.html

Read and write csv files in pandas

Having extra header & python treat it as column headers.

No proper header:
Give proper headers:

Displaying only particular no. of rows:

Removing Not Available, n.a. to NAN

Wanna replace specifically means use The following command: Use dictionary

How to create new csv file in python

Read Excel Files:


Replacing N.A, in excel file

Writing excel file

Controlling the position of table in excel file

Handle missing data in Excel file


To convert string data type to Date data type:

To set the day as index


Module 5 NUMPY in python:

NUMPY:

In case of Anaconda or jupyter notebook, it is in-built.

For installing,

For importing,
Numpy Data types:
Course Structure (Module 2)

Print

New -> Text Fie

Change the name of file (file name – my) & save it

Variable:

You might also like