26
Python For Data Science
Introduction to Python:
Python is a general-purpose interpreted, interactive, object-oriented, and high-level programming language. It was created by Guido van Rossum during 1985- 1990
Why Python ?
Interpreted β Python is processed at runtime by the interpreter. You do not need to compile your program before executing it. This is similar to PERL and PHP.
Interactive β You can actually sit at a Python prompt and interact with the interpreter directly to write your programs.
Object-Oriented β Python supports Object-Oriented style or technique of programming that encapsulates code within objects.
Beginner's Language β Python is a great language for the beginner-level programmers and supports the development of a wide range of applications from simple text processing to WWW browsers to games.
Where we can use Python?
Data Science, Artificial Intelligence, Machine Learning
Image Processing
Robot-Operating-Systems (ROS)
Web frameworks
1.1 Python variables:
Variables are nothing but reserved memory locations to store values. This means that when you create a variable you reserve some space in memory. Python variables do not need explicit declaration to reserve memory space. The declaration happens automatically when you assign a value to a variable.
Standard Data Types:
The data stored in memory can be of many types. For example, a person's age is stored as a numeric value and his or her address is stored as alphanumeric characters. Python has various standard data types that are used to define the operations possible on them and the storage method for each of them.
Python has five standard data types:
Numbers
String
List
Tuple
Dictionary
Python Identifiers:
A Python identifier is a name used to identify a variable, function, class, module or other object. An identifier starts with a letter A to Z or a to z or an underscore (_) followed by zero or more letters, underscores and digits (0 to 9).
Python does not allow punctuation characters such as @, $, and % within identifiers. Python is a case sensitive programming language. Thus, Manpower and manpower are two different identifiers in Python.
26