Hi there !
Python for Data Science is a must-learn skill for professionals in the Data Analytics domain. With the growth in the IT industry, there is a booming demand for skilled Data Scientists and Python has evolved as the most preferred programming language for data-driven development. I would like to give you all a quick overview of Python Programming Language through this blog. Hope You Like it !
Introduction to Python
Python is a popular programming language it was created By “Guido Van Rossum ” and released in 1991. – Python is a an interpreted , object-oriented, high-level programming language with dynamic semantics. its high-level built in data structures, combined with dynamic typing and dynamic binding, make it very attractive for rapid application development, as well as for use as a scripting or glue language to connect existing components together.
· Python’s simple, easy to learn syntax emphasizes readability and therefore reduces the cost of program maintenance. python supports modules and packages, which encourages program modularity and code reuse. the python interpreter and the extensive standard library are available in source or binary form without charge for all major platforms, and can be freely distributed.
Why Python ?
· Programmers fall in love with Python because of the increased productivity it provides.
· There is no compilation step, the edit-test-debug cycle is incredibly fast.
· Debugging Python programs is easy : a bug or bad input will never cause a segmentation fault.
· When the interpreter discovers an error, it raise an exception.
· When the program doesn’t catch the exception, the interpreter prints a stack trace.
· A source level debugger allows inspection of local and global variables, evaluation of arbitrary expressions, setting breakpoints, stepping through the code a line at a time, and so on
· The debugger is written in Python itself , testifying to python’s introspective power. on the other hand often the quickest way to debug a program is to add a few print statements to the source, the fast edit-test-debug cycle makes this simple approach very effective.
Python History and Versions
· Python laid its foundation in the late 1980’s.
· The implementation of python was started in December 1989 by Guido Van Rossum at CWI in Netherlands.
· Python 1.0 : it was released in 1994 and laid the basic principles of the language with emphasis on simplicity, that basically included features like lambda, map,filter, and reduce.
· Python 2.0: it was released in 2000, and it added new features such as list, comprehensions, and garbage collection. Different 2.x subversion are still used in various projects and libraries. the symbol x in 2.x means any subversion of python 2.
· On December 3,2008, python 3.0 was released. it was designed to rectify the fundamental flaw of the language.
![](https://static.wixstatic.com/media/a2206e_5ccb1065534740eaa54e8e8404a29ef6~mv2.png/v1/fill/w_687,h_387,al_c,q_85,enc_auto/a2206e_5ccb1065534740eaa54e8e8404a29ef6~mv2.png)
Python Features
· Easy to Learn – Python has few keywords, simple structure and a clearly defined syntax. this allow the student to pick up the language quickly.
· Easy to Read – Python code is more clearly defined and visible to the eyes.
· Easy to maintain – Python’s source code is fairly easy to maintain.
· A broad Standard Library – Python’s bulk of the library is very portable and cross- platform compatible on UNIX, Windows, and Macintosh.
· Interactive Mode – Python has support for an interactive mode which allows interactive testing and debugging of snippets of code.
· Portable – Python can run on a wide variety of hardware platforms and has the same interface on all platforms.
· Extendable -You can add low-level modules to the Python interpreter. these modules enable programmers to add to or customize their tools to be more efficient.
· Databases – Python provides interfaces to all major commercial databases.
· GUI Programming – Python supports GUI applications that can be created and ported to many system calls, libraries and windows systems, such as windows MFc , Macintosh and the x window system of UNIX.
· Scalable – Python provides a better structure and support for large programs than shell scripting.
Getting Python
The most up-to-date and current source code, binaries, documentation, news, etc., is available on the official website of Python https://www.python.org/
Installing Python
Many PCs and Macs will have python already installed.
To check if you have Python installed on a Windows PC, search in the start bar for Python or run the following on the Command Line (cmd.exe):
C:\Users\Your Name>python --version
To check if you have Python installed on a Linux or Mac, then on linux open the command line or on Mac open the Terminal and type:
python --version
If you find that you do not have python installed on your computer, then you can download it for free from the following website: https://www.python.org/
Alternately, you can download and install a package, which comes with pre-installed libraries. I would recommend downloading Anaconda. Another option could be Enthought Canopy Express.
Python Basic For Data Science
Basic understanding of following topics:
· Variables : Variables refer to the reserved memory locations to store the values. In Python, you don’t need to declare variables before using them or even declare their type.
· Data Types : Python supports numerous data types, which defines the operations possible on the variables and the storage method. The list of data types includes- Numeric , Lists, Strings, Tuples, Sets, and Dictionary.
· Operators : Operators helps to manipulate the value of operands . The list of operators in Python includes- Arithmetic , Comparison , Assignment , Logical, Bit-wise, Membership and identity.
· Conditional Statements : Conditional Statements help to execute a set of statements based on a conditional . There are namely three conditional statements – If, Elif and Else.
· Loop : Loops are used to iterate through small pieces of code. There are three types of loops namely- While ,for and nested loops.
· Functions : Functions are used to divide you code into useful blocks, allowing you to order the code , make it more readable , reuse it & save some time.
Python Libraries
Pandas : Pandas is a machine learning library in Python that provides data structures of high -level and a wide variety of tools for analysis. it allows for fast analysis and data cleaning/ preparation. sometime, it’s called Python version of an Excel or Python version of R DataFrames. it excels in performance and productivity. it also has built – in Data Visualization features. it can work with data from a wide variety of sources.
We can install pandas from command line –
· Conda install pandas (From Anaconda Distribution )
· pip install pandas
SciPy : SciPy (Scientific Python) stands on top of NumPy. with this library, we can carry out functionality like Linear Algebra, Fourier Transform, Optimization , and many others. it has a number of user-friendly and efficient numerical routines. These include routines for optimization and numerical integration.
NumPy : NumPy is a Linear Algebra Library for Python , the reason it is so important for Data Science with Python is that almost all the libraries in the PyData Ecosytem rely on NumPy as one of their main building blocks.NumPy is also incredibly fast , as it has bindings to C Libraries. NumPy arrays are the main way we will use NumPy throughout the course. NumPy arrays essentially come in two flavors: Vectors and matrices.
We can install NumPy from command line –
pip install numpy
Matplotlib : Matplotlib will let you plot different kinds of graphs. These include pie charts, bar graphs, histograms, and even heat plots.
Scikit- learn : Scikit -learn is great for machine learning . it will let you statistically model and implement machine learning. The tools for these include clustering , regression , classification, and dimensionality reduction.
Seaborn : Seaborn is good with statistical data Visualization. Making use of it, we can create useful and attractive graphics.
Scrapy : Scrapy will let you crawl the web. used to extract the data from the web page with the help of selectors based on Xpath.
I talked about Python Introduction. It’s History. The Python Versions , Python Features and Python Libraries.
In my next blog. I will Talk about the Basics of Programming in Python Language. And i will be writing some basic programs.
Hope you like the blog and find it useful…
Thank You !
Comments