Summer Training Report: Python and Machine Learning Using Python
Summer Training Report: Python and Machine Learning Using Python
ON
Done by :-
SHIVANSH BOHRA
17001004054
MECHANICAL Engineering
Submitted To :-
DR.ANIL NARWAL
PREFACE
The objective of a practical training is to learn something
about industries practically and to be familiar with a
working style of a technical worker to adjust simply
according to industrial environment. As a part of
academic syllabus of four year degree course in ME, every
student is required to undergo practical training of days.
We are student of 3rd year ME and this report is written
on the basis of practical knowledge acquired by me during
the period of practical training taken from “INTERNSHALA
Trainings”.
This report deals with the equipments their relation and
their general operating principle. Sincere efforts have
been made to present this report on Programming with
python.
Inspire of all our best efforts, some unintentional errors
might have eluded, it is requested to neglect them.
ABSTRACT
The objective of a practical training is to learn something
about industries practically and to be familiar with a
working style of a technical worker to adjust simply
according to industrial environment . This report deals
with the equipments their relation and their general
operating principle.
Python, an interpreted language which was developed by
Guido van Rossum came into implementation in 1989.
The language supports both object oriented and
procedure oriented approach. Python is designed to be a
highly extensible language. Python works on the principle
of “there is only one obvious way to do a task” rather
than “there is more than one way to solve a particular
problem”. Python is very easy to learn and implement.
The simpler syntax, uncomplicated semantics and
approach with which Python has been developed makes it
very easier to learn. A large number of python
implementations and extensions have been developed
since its inception.
Training Cover provides both six weeks as well as six
months training in Python. Python is divided into two
parts as “Core Python” and “Advance Python”.
INDEX
INTRODUCTION
PYTHON :
Python is a high-level, interpreted, interactive and object-oriented
scripting language. Python is designed to be highly readable. It uses
English keywords frequently where as other languages use
punctuation, and it has fewer syntactical constructions than other
languages.
History of Python :
Python was developed by Guido van Rossum in the late eighties and
early nineties at the National Research Institute for Mathematics and
Computer Science in the Netherlands.
Python is derived from many other languages, including ABC, C, C++,
Algol-68, SmallTalk, and Unix shell and other scripting languages.
Python is copyrighted. Like Perl, Python source code is now available
under the GNU General Public License (GPL).
Python is now maintained by a core development team at the
institute, although Guido van Rossum still holds a vital role in
directing its progress.
Python Features :
Python's features include:
OPERATORS
Arithmetic operators:
Python operator Precedence
Chapter 3
COLLECTION IN PYTHON
3.1 LIST
The list is a most versatile data type available in Python which can be
written as a list of comma-separated values (items) between square
brackets. Important thing about a list is that items in a list need not
be of the same type.
Creating a list is as simple as putting different comma-separated
values between square brackets. For example –
Keywords:
Keywords are the reserved words in Python. We cannot use a keyword as a
variable name, function name or any other identifier.
Data Types & Variables:
Numeric:
Python, numeric data type represent the data which has numeric value. Numeric value can be
integer, floating number or even complex numbers. These values are defined
as int, float and complex class in Python.
Float – This value is represented by float class. It is a real number with floating point
representation. It is specified by a decimal point. Optionally, the character e or E followed
by a positive or negative integer may be appended to specify scientific notation.
Complex Numbers – Complex number is represented by complex class. It is
specified as (real part) + (imaginary part)j. For example – 2+3j
Sequence Type:
Python, sequence is the ordered collection of similar or different data types.
Sequences allows to store multiple values in an organised and efficient fashion.
There are several sequence types in Python –
String
List
Tuple
1) String
In Python, Strings are arrays of bytes representing Unicode characters. A string is a collection
of one or more characters put in a single quote, double-quote or triple quote. In python there
is no character data type, a character is a string of length one. It is represented by str class.
2) List
Lists are just like the arrays, declared in other languages which is a ordered collection of data.
It is very flexible as the items in a list do not need to be of the same type.
3) Tuple
Just like list, tuple is also an ordered collection of Python objects. The only difference
between type and list is that tuples are immutable i.e. tuples cannot be modified after it is
created. It is represented by tuple class.
Boolean
Data type with one of the two built-in values, True or False. Boolean objects that are equal
to True are truthy (true), and those equal to False are falsy (false). But non-Boolean objects
can be evaluated in Boolean context as well and determined to be true or false. It is denoted
by the class bool.
Set
In Python, Set is an unordered collection of data type that is iterable, mutable and has no
duplicate elements. The order of elements in a set is undefined though it may consist of
various elements
Dictionary
Dictionary in Python is an unordered collection of data values, used to store data values like a
map, which unlike other Data Types that hold only single value as an element, Dictionary
holds key:value pair. Key-value is provided in the dictionary to make it more optimised.
Each key-value pair in a Dictionary is separated by a colon :, whereas each key is separated
by a ‘comma’.
Mutability: The property of whether or not data objects can be
modified in the same memory location where they are stored is called
Mutuablity.
Numeric Data types:
For example:
Set operations:
There are a large number of set operations, including
union (|), intersection (&), difference (-), symmetric
difference (^). These are unusual operations, so we'll look
at them in some detail. In addition to this operator
notation, there are method functions which do the same
things.We'll look at the method function versions
below.We'll use the following two sets to show these
operators.
>>>
fib=set( (1,1,2,3,5,8,13) )
>>>
prime=set( (2,3,5,7,11,13) )
Union, |
>>>
fib | prime
Intersection, &
>>>
fib & prime
set([2, 3, 5, 13])
Symmetric Difference, ^
>>>
fib ^ prime
Append() :
Conditional statements: A statement that controls the flow of execution
depending on some condition.
1)if Statement is used for decision-making operations. It contains a body of code
which runs only when the condition given in the if statement is true. If the
condition is false, then the optional else statement runs which contains some code
for the else condition.
Syntax:
if expression
Statement
else
Statement
By Using Functions:
In Python, a function is a group of related statements that performs a specific task.
Functions help break our program into smaller and modular chunks. As our
program grows larger and larger, functions make it more organised and
manageable. Furthermore, it avoids repetition and makes the code reusable.
Some functions:
Overview of Object Oriented Language:
Foreign key: It is a key used to link two tables together. A FOREIGN KEY is
a field (or collection of fields) in one table that refers to the PRIMARY KEY in
another table.
Some Methods:
Creating a database:
Difference between COMMIT and ROLLBACK in SQL
1. COMMIT :
COMMIT in SQL is a transaction control language which is used to permanently save the
changes done in the transaction in tables/databases. The database cannot regain its previous
state after the execution of it.
2. ROLLBACK :
ROLLBACK in SQL is a transactional control language which is used to undo the
transactions that have not been saved in database. The command is only be used to
undo changes since the last COMMIT.
Widgets Description
Application A container widget inside which other
window elements are arranged .
Button An area on which a mouse click triggers
some operations.
Text box Reads text input from keyboard.
Radio Button Allows a user to select one of several
options .
List box / drop Presents a selectable list of items .
down list
Checkbox Allows a user to select one or more of
several options .
QListWidget :
QListWidget class is an item-based interface to add or
remove items from a list. Each item in the list is a
QListWidgetItem object. ListWidget can be set to be multi-
selectable.
Following are the frequently used methods of QListWidget
class:
Python Applications:
Python supports cross-platform operating systems which makes building
applications with it all the more convenient. Some of the globally known applications
such as YouTube, BitTorrent, DropBox, etc. use Python to achieve their functionality.
1. Web Development :
2. Game Development :
Python is also used in the development of interactive games. There are libraries
such as PySoy which is a 3D game engine supporting Python 3, PyGame which
provides functionality and a library for game development.
Machine Learning and Artificial Intelligence are the talks of the town as they yield the
most promising careers for the future. We make the computer learn based on past
experiences through the data stored or better yet, create algorithms which makes the
computer learn by itself. The programming language that mostly everyone chooses?
It’s Python. Why? Support for these domains with the libraries that exist already .
Data is money if you know how to extract relevant information which can help you
take calculated risks and increase profits. You study the data you have, perform
operations and extract the information required. Libraries such as Pandas, NumPy
help you in extracting information.
You can even visualise the data libraries such as Matplotlib, Seaborn, which are
helpful in plotting graphs and much more. This is what Python offers you to
become a Data Scientist.
5. Desktop GUI :
You can start out with creating simple applications such as Calculators, To-Do apps
and go ahead and create much more complicated applications.
Python can be used to pull a large amount of data from websites which can then be
helpful in various real-world processes such as price comparison, job listings,
research and development and much more.
Python has a library called BeautifulSoup which can be used to pull such data and
be used accordingly. Here’s a full-fledged guide to learn Web scraping with Python.
7. CAD Applications:
Python is based on C which means that it can be used to create Embedded C software for
embedded applications. This helps us to perform higher-level applications on smaller devices
which can compute Python.
Python can be used to develop applications that can multi-task and also output
media. Video and audio applications such as TimPlayer have been developed using
Python libraries and they provide better stability and performance compared to other
media players.
Python has a variety of applications where it can be used. No matter what field you
take up, Python is rewarding. So I hope you have understood the Python
Applications and what sets Python apart from every other programming language.
BIBLIOGRAPHY
Training Manual :
https://trainings.internshala.com
Certificate