Showing posts with label python tutorial. Show all posts
Showing posts with label python tutorial. Show all posts

Tuesday, September 29, 2020

How to Learn Python

 In this post you will learn how to learn python as beginner step by step easy way to learn python within one month.If your are thinking to start learning python then I guess you made the right choice by starting to learn Python because Python is the world’s fastest and most popular programming language not just among SDE’s but also among  Data Analysts, Scientists and even Kids too!!! The reason is simple because Python is a very beginner-friendly programming language and one of the most used programming language. Python has found its places everywhere such as web development, machine learning, and artificial intelligence or even the programming of micro controls – 

You may have  doubt why everyone says python is easy programming language the reason is due to its syntax and readability. hence it reduces the cost of maintenance of the program. The syntax of Python is smaller than most other programming languages like Java, C, C++.

Before starting learning about Python, it is very important to understand your areas of interest. Pick an area you’re interested in, such as:

 Data science / Machine learning

  AI

  Mobile apps

 Web Development

  Games

  Scripts to automate your work 

Now we will see step by step the best way to learn python programming




Step 1: ( one week to 15 Days)

Python Basics like history of python, variables, oprtaors, functions and control structures these topics extremely easy compared to other languages like JAVA, c, c++

Step 2: OOPS concept, Built-in Data Structures (10 to 15 Days)

OOPS in Python

List, Tuples, Dictionary.

String Formatting

Exception Handling

If you are a beginner then I would recommend you to focus on this section as it is widely used while making complex applications.You might not understand a lot of things at first, but give things time to sink in and it will make sense.

Step 3: Web Frameworks(2 Weeks)

There are so many frameworks for web applications in Python.

 Django: A high-level web framework mostly used in startups and enterprises for web development. It follows the MVC pattern and you can use multiple databases such as PostgreSQL, MySQL, SQLite, and Oracle.

Flask: Flask is one of the easiest micro-frameworks to learn in Python.

Web-crawler:   

Building a web crawler was interesting as well,  crawler which was used by search engines back in the early days to crawl web pages, find links and store those links in a file.

Step 4: Python Libraries ( 1 week)

If you aspire to be a data analyst/ data scientist then focus on learning these libraries.

Learned about the Numpy and Pandas library which are extensively used to perform data analysis with Python. 

Step 5:     ML: (2 weeks)

For learning you need to learn 

TensorFlow: It is one of the most famous and popular deep learning library developed by Google

Scikit-Learn: It is Machine learning library for Python designed to work with numerical libraries.

 PyTorch: It is the library that can handle dynamic computation graphs.

Step 6: Learn Automation with selenium(1 week)

After learning almost everything about Python selenium felt pretty easy.

Selenium is originally used for testing purposes but it turns out that you can automate various tasks with it. So overall It took around 10 - 14 weeks to complete the python course

Note that  you have to dedicate 2–3 hours every day for learning.

After learning everything try to build your own projects like calculator, weather applicaton, E commerce, online cv generator etc.. 

Here are the python best books for beginners

learn python

python cookbook

python essenstional reference

python in nutshell

online Resources:

Some of the tips from my side:

 Have patience, it’s not just in case of learning Python but also it’s in the case of learning another language. Learning a first language always requires more effort and time so understand that it will take time to sink everything.

 Be consistent, if you are not consistent in learning it will take a lot more time and effort.

The building project is always helpful in building confidence so don’t ignore its importance.

Due to some complex terms, errors, and issues, you will feel like giving up. Don’t do that, it happens with everyone in programming.

    






























Friday, July 19, 2019

How do you Use Python to make Website?

In this post you will know how to make websites using python. Python is an easy, flexible and powerful general purpose programming language (which is specially suited for web development), but you should bear in mind that in order to become a web developer you must learn several different skills besides python.

Firstly you need to understand that a website/ web application consists of two major parts.

The front end: Client side.

The back end: Server side.

Front-end / Client side is nothing but what you see as a user on the browser, i.e the webpage, the layout, images and the small widgets like buttons and badges

The first basic skill you must learn is HTML.

HTML is the markup language of the web. All web pages are created with HTML, which defines the different elements contained in a web page.



Then you should learn CSS, which is another little language that defines the way each HTML element looks within a page (its color, the font type, its position on the page, etc).

And the third skill you should master to become a complete web developer is JavaScript.
JavaScript is a scripting language, just as python, but it runs within the browser.
It is a fundamental part of HTML 5 (the newest incarnation of the HTML , which powers all the new applications being written for the web and mobile phones and tablets (iphone, ipad, blackberry, etc...).

HTML + CSS + JAVASCRIPT are different parts of the whole HTML5 platform, and they all work in tandem to create a full web application.

Where does Python fit in?

Although you can create a full web application with just HTML, CSS and javascript, chances are that your application will need to access data stored in a server, most likely a database.
That means that you will have to write code that will be run in a remote server rather than in the browser.

The server side is different than the browser (or client side). In the client side you only have one option: JavaScript.On the other hand, you can use any imaginable language on the server side.
People use php, java, ruby, python, c#, etc...



Python will let you talk to the database or data store, perform queries, retrieve information and format the output to your web page.

Is it possible to forget about JavaScript and write your whole application in python?
Yes, and many web sites work this way. But you would be limiting yourself (and your website usability).

Code written in JavaScript runs in your browser (it doesn't need to communicate with a distant server and wait for the response) hence, its faster, and the user experience is better. That's why the new HTML5 web applications feel more and more like desktop applications.
Applications written entirely in JavaScript that talk directly to the database are known as Ajax applications.

But code written on the server side may give you more security and scalability, so both sides should be mastered to become a competent web developer.

As for web development frameworks:
Again, please first stand on your feet... When you reach the moment where you find yourself needing a framework, you will probably find out that you can get by with a simpler solution rather than Django. Django lets you create the whole structure of your website on the server side.

My advice: Forget about all these things, get a good python tutorial and learn it (and enjoy it!) before looking at all the other technologies you will need.

Wednesday, July 17, 2019

Advantages and Disadvantages of Python

In this post you will learn the advantages and limitations of python.  Python is an object-oriented, high-level programming language with integrated dynamic semantics primarily for web and app development. The following are the advantages and disadvantages of python.

Advantages of Python

1- Python is easy to learn for even a novice developer. Its code is easy to read and you can do a lot of things just by looking at it. Also, you can execute a lot of complex functionalities with ease, thanks to the standard library.

2- Supports multiple systems and platforms.

3- Object Oriented Programming-driven.

4- With the introduction of Raspberry Pi, a card sized microcomputer, Python has expanded its reach to unprecedented heights. Developers can now build cameras, radios and games with ease. So, learning Python could open new avenues for you to create some out-of-the box gadgets.

5- Python has a plethora of frameworks that make web programming very flexible. Django is the most famous Python framework for web development.

6- Gives rise to quick development by using less code. Even a small team can handle Python effectively.

7- Allows to scale even the most complex applications with ease.

8- A large number of resources are available for Python.

9- Offers a built in testing framework to set debugging time and enable fastest workflows.

10- IT giants like Yahoo, Google, IBM, NASA, Nokia and Disney prefer Python.



Disadvantages of Python

1- Python is slow.

2- Python is not a very good language for mobile development.

3- Python is not a good choice for memory intensive tasks.

4- It's near impossible to build a high-graphic 3D game using Python.

5- Has limitations with database access.

6- Python is not good for multi-processor/multi-core work.

Wednesday, February 13, 2019

python frameworks to learn in 2019

In this post you will know the best python frameworks for full stack frameworks in python and non-full stack frameworks in python. Here is a list of top 10 Python frameworks to learn in 2019

Web Frameworks offered by Python Programming Langauge: -

1. Full-Stack Frameworks in Python-
a. Django

b. web2py

c. Pylons

d. Tornado

e. Django-hotsauce

2. Non- Full-Stack Frameworks in Python-

a. Python Bottle

b. CherryPy

c. Python Flask

d. Pyramid

e. Pycnic

So let us see one by one-

Django-

Django was originally developed for content-management systems, but is now used for many kinds of web applications. It also provides a web server for development use. Famous companies that use Django Python are Mozilla, Pinterest, Disqus, Instagram etc.

web2py-

It uses the MVC built-in ticketing system to manage errors. It has no configuration files, and you can even run it off a USB drive.
Django-hotsauce-It is a Pythonic API that will help you create scalable web applications using the WSGI 1.0 spec. Also provides native bindings for the Schevo DBMS, Durus, ZODB, & Authkit projects.

Pylons-

With Pylons, Web development is fast, flexible, & easy. It is built on top of Paste. After being merged with Pyramid to form the Pylons project, it is in maintenance-only status.

Tornado-

 It is great with non-blocking I/O. Tornado finds its origin in the FriendFeed project, which now belongs to Facebook
Python Bottle-You can use to create small Web applications. It provides request-dispatching routes with URL-parameter support, templates, key/value databases, & a build-in HTTP server.

CherryPy-
 It supports various web servers like Apache, IIS, & so. CherryPy will let you launch multiple HTTP servers at once.

Python Flask-

It will help you to develop small, simple applications. It is a microframework for Python. It includes a built-in development server, & unit-testing support.

Pyramid-It is a framework for large applications. It makes real-world Web application development & deployment more fun, predictable, & productive

Pycnic- Pycnic is the fastest web frameworks for Python for developing JSON APIs



Reasons to learn python:

1. Community

Python has a large community wants to see it grow continuously. A large community means the availability of a large number of libraries, modules, and packages to help you with your project.


2. Career Opportunities

Python opens a lot of doors for you. Python & Ruby developers earn the 2nd highest grub, next to Swift. The average package of a Python developer with around 4 years of experience is approximately 5 LPA in India. Python finds use in cybersecurity.

3. Python in Web Development

There are many frameworks of Python. Many of these were meant for web development they are Django, Pylons, web2py, and Flask. Of these, Django and Flask are quite impressive.

4. Python in Artificial Intelligence and Machine Learning

Without Python, MATLAB would rule the AI and ML world but with Python it is possible to carry out complex computations using a single import statement followed by a function call. Python is also known as the language for Computer Science with its speed and flexibility.

5. Raspberry Pi

Raspberry Pi is one of the most interesting parts of learning Python. A microcomputer the size of a credit card, it is capable of a lot. With it, you can explore the word of technical DIYs, it include making robots, arcade machines, remote-controlled toys, & cameras and with Sonic Pi you can even make music.

6.  Startups and Corporates- Python for Both

Python is literally everywhere from startup to the unicorn, is a perfect blend of uniqueness and flexibility make it a suitable choice for any project. It gets the best of both worlds. Giants like NASA, Google, Disney, are always lookout for talented Python professionals.

How to become full stack Python Developer

Python tops the list of the most popular programming languages in 2018 and will be in top 3 popular programming languages in 2019 too.

So geeks this post is dedicated to those people who knows Python and wants to build their career in Full Stack Development or people who wants to learn python and become Full Stack Developer.

What is Full Stack Developer?

Full Stack in Computer Science comprises of complete Front end and complete Back end. Some people might call Front end as UI and Back end as Server Side.

So a Full Stack developer is someone who can work on Front end and Back end on his own and can deliver the application independently.

Now Let’s talk about Full Stack Python

Full Stack Python:

When we talk about web development, the development is done with frameworks these days. No one wants to write the same chunk of code multiple times reducing efficiency and productivity.

Such frameworks are there in Python too, the two most widely web development frameworks are Django and Flask.

When we develop any application, it gets divided into two parts:

Front end
Back end.

Front end: When we talk about front end there are numerous technologies to build the Front end of the application. You need to have the knowledge of following languages. HTML, CSS, JavaScript, jQuery, Bootstrap. You can even explore Angular JS /React JS which are optional.

Back end: Flask or Django Python Frameworks and for databases you can master any of these but have a high level understanding of all Oracle, Mysql, Sqlite3, Mongo DB.



The following languages/frameworks/tools/ must learn to become full stack developer:

  • You need to learn python.
  • You need to Learn HTML
  • You need to learn javascript.
  • You need to learn a database management system either SQL or NO-SQL system. Mysql is a good place to start.
  • You will also need to learn frameworks like Django, Flask, or JS frameworks like VUEJS, Angular or REACT.
  • You may also need to learn search tools like ElasticSearch, Caching Tools Like Redis, Queue Systems, Learn some Cloud Server Services like AWS, Azure,Digital Ocean, Heroku and the rest.
  • Atleast one web server (nginx, Apache, etc)
  • Atleast one deployment operating system (Ubuntu, CentOS, FreeBSD, etc)
  • Atleast one version-control system (git. don't bother with the etc)
  • You also learn how to keep learning.

Friday, November 23, 2018

Features of Python

In this post you will know the favorite features of Python. Python is 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.

The following are the some of the best features of Python:

1. Easy to code and read-

Python is very easy to code as compared to other popular languages like Java & C++, it is easier to code in Python. Anyone can learn python syntax in just a few hours.Not only is it easy to code, it is also easy to understand. Readability is another advantage, since it is dynamically-typed, it mandates indentation. This aids readability

2.Free and Open-Source-

Firstly, Python is freely available. You can download it from the following link 


Secondly, it is open-source, this means that source code is available to the public. you can download it, use it, change it, & distribute it which is called Free/Libre and Open Source Software (FLOSS).

3. High- Level-

It is a high-level language. When you write programs in python, you don’t need to remember the system architecture, nor do we need to manage the memory, this makes it more programmer friendly.

4. Portable-

If you have written a Python code for windows machine. If you want to run on a Mac, you don’t need to change to it for the same. You can take one code & run it on any machines. This makes Python a portable language.



5. Extensible-

Python can be extended to other languages. You can write some of your code in languages such as C++ or C, this comes in handy especially in projects.

6. Embeddable-

Python is embeddable as well. you can put your python code in your source code of a different language like C++ , this let us add scripting capabilities to or code in other language.

7. Object-Oriented-

Python supports both procedure-oriented & object-oriented programming, is one of the key python features. Functions help us with code re-usability, classes, & objects let us model the real world. A class allow the encapsulation of data & functions into one.

8. Large Standard Library-

Contain code for various purpose like regular expressions, documentation-generation, unit testing, threading, web browsers, CGI, database, email, image manipulation etc. So, you don’t have to write the complete code for that manually.

9. Dynamically Typed-

Python is dynamically-typed, this means that the type for a value is decided at runtime, not in advance. This is why you don’t need to specify the type of data while declaring it.

10. Extensive Libraries

The Python Standard Library is huge indeed. It can help you do various things involving regular expressions, documentation generation, unit testing, threading, databases, web browsers, CGI, ftp, email, XML, XML-RPC, HTML, WAV files, cryptography, GUI(graphical user interfaces) using Tk, and also other system-dependent stuff. Remember, all this is always available wherever Python is installed. This is called the "batteries included" philosophy of Python.

Thursday, October 25, 2018

Best Websites to learn Python

In this blog you will know the best websites to learn Python. Python is a high-level and object-oriented scripting language whose popularity has been on a steady rise. It is a general-purpose language that has a wide range of applications. Another reason behind its popularity is the readability and minimalism. A complex instruction can be expressed in a few lines of codes.

You don’t have to attend a university or any other school to learn Python programming. There are more than enough Python programming lessons available online. All you need is a computer and an internet connection. Here are the best websites to learn Python programming.

The following are the websites to learn Python:


Are you completely new to programming? If not then we presume you will be looking for information about why and how to get started with Python. Fortunately an experienced programmer in any programming language (whatever it may be) can pick up Python very quickly. It's also easy for beginners to use and learn, so jump in! Python.org is the official reference point for everything that is related to Python programming. The site contains the official documentation of Python programming. You can use the documentation to get any information that concerns Python.

In addition to the documentation, Python.org also contains several tutorials that can take learners through the basics of Python. It also covers some advanced topics such as Python libraries and modules.


This is a free class for people with a little bit of programming experience who want to learn Python. The class includes written materials, lecture videos, and lots of code exercises to practice Python coding. These materials are used within Google to introduce Python to people who have just a little programming experience. The first exercises work on basic Python concepts like strings and lists, building up to the later exercises which are full programs dealing with text files, processes, and http connections. The class is geared for people who have a little bit of programming experience in some language, enough to know what a "variable" or "if statement" is. Beyond that, you do not need to be an expert programmer to use this material.

The content on this website is available in different formats. You will have unlimited access to both eBooks and video tutorials. This gives learners the freedom to choose whichever format that they want. You will also encounter exercises at the end of each topic or concept.




Tutorialspoint is a popular website that provides tutorials on different programming language including Python. It covers both the basics and advanced levels of Python language. You will learn how to install a Python development environment, the syntax, control functions among other advanced topics.

Tutorialspoint will teach you how to create web applications, manipulate databases and even create games using Python.


LearnPython.org is a website where you not only learn how to code but also write and practice code on your web browser. It has a built-in interpreter right on the website as well as a tutorial series. It provides basic python tutorials, which means beginners will be able to keep up with the tutorials and feel less intimidated by the material. LearnPython also includes programming exercises at the end of each lesson.



Monday, October 23, 2017

Python Interview Questions and answers

In this post we will learn frequently asked Python Interview Questions and answers for freshers and also for experienced developers.In previous post we had discussed about why Python so powerful for Data Science, one of the frequently raised question that one so go through that post as well.

1) What is Python?

Ans: Python is a high level ,Object oriented,most successful interpreted language. It is a portable language,since it can run on different platforms such as Windows,Linux,Unix,Mac...It is a interpreted language that means when write a Python script it doesn't need to get compiled before execution.

2) What are the Benefits of Python?

Ans:

  1. Python is a Object Oriented Programming language as you can define classes along with the composition and Inheritance. It doesn't use any access specifier like Public or private
  2. It provides very high level dynamic data types and supports dynamic type checking
  3. It can be use as Scripting language or can be compiled to byte-code for building large applications.
  4. We can use Python for developing Web applications,automation,Scientific Modeling,Big Data applications etc..
  5. It can be easily integrated with C,C++,JAVA,COBRA,COM .
  6. It is extensible
3) What are the Data types in Python?

Ans: Python has 5 Standard Data types:

  1. Numbers
  2. String
  3. List
  4. Tuple
  5. Dictiornary
4) Is Multithreading supports in Python?

Ans: YES,Python has multi-threading package. It has a Construct called Global Interpreter Lock(GIL). This GIL makes you feeling only one thread is 'executing' at any one time.This happens very quickly so to the human eye it may seem like your threads are executing in parallel, but they are really just taking turns using the same CPU core.This means that if you want to make your code run faster then using the threading package often isn’t a good idea.

5)What is the output of print str if str = ‘Hello World!’?


Ans: Hello World!.

6) How to overload methods in Python?

Ans: Python's constructor: 
_init__ () is a first method of a class. Whenever we try to instantiate a object __init__() is automatically invoked by python to initialize members of an object.

7)How To Find Bugs Or Perform Static Analysis In A Python Application?

Ans: You can use PyChecker, which is a static analyzer. It identifies the bugs in Python project and also reveals the style and complexity related bugs.Another tool is Pylint, which checks whether the Python module satisfies the coding standard.

8) How to achieve Inheritance in Python?

Ans: Inheritance allows One class to gain all the members(say attributes and methods) of another class. Inheritance provides code re-usability, makes it easier to create and maintain an application. The class from which we are inheriting is called super-class and the class that is inherited is called a derived / child class.

9) What is the usage of help() and dir() function in Python?

Ans: Help() and dir() both functions are accessible from the Python interpreter and used for viewing a consolidated dump of built-in functions. 

Help() function: The help() function is used to display the documentation string and also facilitates you to see the help related to modules, keywords, attributes, etc.
Dir() function: The dir() function is used to display the defined symbols.

10)How is memory managed in Python?

Ans: Python memory is managed by Python private heap space. All Python objects and data structures are located in a private heap. The programmer does not have an access to this private heap and interpreter takes care of this Python private heap. 
The allocation of Python heap space for Python objects is done by Python memory manager. The core API gives access to some tools for the programmer to code.
Python also have an inbuilt garbage collector, which recycle all the unused memory and frees the memory and makes it available to the heap space.

11)What is dictionary in Python?

Ans: The built-in datatypes in Python is called dictionary. It defines one-to-one relationship between keys and values. Dictionaries contain pair of keys and their corresponding values. Dictionaries are indexed by keys.

Let’s take an example:

The following example contains some keys. Country, State & Captain. Their corresponding values are India, Andhra and Kohili respectively.


dict={'Country':'India','State':'Andhra','Captain':'kohli'}
print dict[Country]
India
print dict[State]
Andhra
print dict[Captian]
Kohli

12)What is pickling and unpickling in Python?

Ans: Pickling is a process in which a pickle module accepts any Python object, converts it into a string representation and dumps it into a file by using dump() function.
Unpickling is a process of retrieving original Python object from the stored string representation for use.

13) How Python does Compile-time and Run-time code checking?

Ans: In Python some amount of coding is done at compile time, but most of the checking such as type, name, etc. are postponed until code execution. Consequently, if the Python code references a user -defined function that does not exist, the code will compile successfully. The Python code will fail only with an exception when the code execution path does not exist.

14)Which command is used to exit help window or help command prompt?

Ans: "quit" command is used to exit help window or help command prompt.

15)What Is The Key Difference Between A List And The Tuple?
Ans: 
The major difference between a list and the tuple is that the list is mutable while tuple is not. A tuple is allowed to be hashed, for example, using it as a key for dictionaries.

16)Is There A Switch Or Case Statement In Python? If Not Then What Is The Reason For The Same?

Ans:
No, Python does not have a Switch statement, but you can write a Switch function and then use it.

 17)What Is A Built-In Function That Python Uses To Iterate Over A Number Sequence?

Ans: 
range() generates a list of numbers, which is used to iterate over for loops.
Example:
for i in range(5):
    print(i)

The range() function accompanies two sets of parameters.

range(stop)
stop: It is the no. of integers to generate and starts from zero. eg. range(4) == [0, 1, 2,3].
range([start], stop[, step])
start: It is the starting no. of the sequence.
stop: It specifies the upper limit of the sequence.
step: It is the incrementing factor for generating the sequence.

Points to note:
Only integer arguments are allowed.
Parameters can be positive or negative.

18)What are the Popular Frameworks of Python.

Ans: Major Frameworks: Django and Pyramid

Minor Frameworks: Bottle and Flask

19) How to take input from the User in Python?

Python provides a built-in method to accept input from the user.
It is as follows: input(“Enter the Input”)
However, in order to store the input in a variable, you must write a variable name before the input() method.
It can done as follows: var1=input(“Enter the input”)

20)What are the various Exceptions identified by Python?

Ans: The various exceptions identified by Python Environment are as follows:
1. IOError
2. IndexError
3. KeyError
4. NameError
5. SyntaxError
6. ValueError
7. TypeError

21)What is a Frame in Python GUI?

Ans: A Frame in Python can be related as a storage holder for other Graphical User Interface or GUI elements such as Label, Text Entry, Text Box, Check Button, RadioButton, etc.

22)What is the difference between input() method and raw_input() method?

Ans: raw_input() method returns string values whereas input() method returns integer vaues.
Input() method was used in Python 2.x versions whereas Python 3.x and later versions use raw_input() method. However, input()method has been replaced by raw_input() method in Python 3.x.

24)What is range() method in Python?

Ans: Range() method is Python is used as a Looping construct. It takes in 2 mandatory parameters and 1 optional parameter.

Example: range(1,20,2)
This method prints numbers after every alternate iterations between 1 and 10. It prints 1 3 5 7 9,11,13,15,17,19

25)Which method is used to find out the location of the pointer in a file?
Ans: The tell() method is used to return the current location or position of the read/write pointer within the file. This method doesn’t require any parameter to be passed in it.

Syntax:
FileVariableName.tell()

26)Why is Finally Block used in Python Exception Handling?

Ans: A Finally Block is generally used in association with try and catch blocks in Python. A Finally Block executes itself no matter if an error occurs at run time or not. It is the default execution block in Python Exception Handling technique.

27)How do you print the sum of digits from 1 to 100 in Python?

Ans:   print(sum(range(1,101))
This command would print in the sum of digits from 1 to 100.

28) How do you copy an object in Python?

Ans. Using the functions copy.copy() and copy.deepcopy()

29)How Do I Generate Random Numbers In Python?

Ans: The standard module random implements a random number generator.
Usage is simple:
import random
random.random()
This returns a random floating point number in the range [0, 1).

30)How Do I Interface To C++ Objects From Python?

Ans: Depending on your requirements, there are many approaches. To do this manually, begin by reading the "Extending and Embedding" document. Realize that for the Python run-time system, there isn't a whole lot of difference between C and C++ -- so the strategy of building a new Python type around a C structure (pointer) type will also work for C++ objects.






Why Python is so Powerful for Data Science

In this post we will Discuss about why python is so powerful for Data Science, Why Data Scientists love coding in Python? Python is the language of choice for data scientists because it is easy to learn, scalable, awesome visualization packages and excellent python community where you can find data science libraries.Python's popularity for data science is largely due to the strength of its core libraries (NumPy, SciPy, pandas, matplotlib, IPython), high productivity for prototyping and building small and reusable systems, and its strength as a general purpose programming language. 

Python is a language that builds upon and extends over 50 years of research in numerical methods and scientific computing. It is possible to apply very complex, well developed algorithms to real world data problems quickly and cleanly.Python has great tools, like IPython Notebooks, for Agile programming and collaboration.  It is very easy to sit down with a client and knock out prototype algos for them in a matter of days.  It is easy to iterate, and the handoff is working prototype that can readily be productionalized by other team members.   Compare this to say R, which is comparatively hard to get into production, or Java, which takes 10 times longer to code up.


Since data scientists are also often involved with wiring together network applications, programming for the web, scripting and automating data processing jobs and other processes, and lots of ad hoc data munging (the kind of stuff people loved using Perl for in the 90s), it's very desirable to be able to do all these things, in addition to the actual analysis and modeling, in a single language.By using Python you can build a program very quickly, profile and identify bottlenecks, then optimize by using better array programming techniques.

Data scientists need to use data visualizations to clearly communicate outputs and predictions to stakeholders at any level of a business. This is the real value a great data scientist can provide – without this, it’s a zero-sum game.Hence, Python has become a programing language that links between different units across the business and a direct channel for data sharing and processing language. 

IPython-Notebook:

This is just a GREAT tool. You can run multiple lines/blocks of code in different cells, you can play with them, move them up or down, and you can even get your results appear just underneath the cell. It really is like the magical organizer that Data Scientists (and people who run code and want to iterate) have always dreamed of.  You can also write R, SQL, Scala, and other languages in IPython-Notebook which makes the work-flow much easier and efficient.

Python is easy to learn:

Python's main advantage is that anyone can learn it quickly and easily. The language was designed to be simple.

Scalability:

Relative to other language/Packages for Data Science (as MatLab, Stata, R) Python is much faster. It’s true that Java and Scala are much faster than Python (x3), but with Anaconda (Continuum Analytics) Python has caught up to speed!
As a Data Scientist, I prefer to run my code and get my output in Python relative to the traditional languages that are computationally slower. As always, there are trade-offs. 

Growing Data Analytics Libraries:

With Python, you can find a large variety of Data Analytics/Data Science Libraries (as others have mentioned here: NumPy, SciPy, StatsModels, Scikit-Learn, Pandas, etc.) - which are exponentially growing over time. Constraints (in optimization methods/functions) that were missing a year ago are no longer an issue, and you can find a proper robust solution that works reliably. 

Visualization / Graphics: 

Python is not as good as R (yet), but we’ll see more and more cool APIs (e.g., Plotly) and Data Visualization libraries that make the partial advantage of R insignificant compared to Python. You can do really cool stuff with Python.

Powerful statistical and numerical packages:

  1. NumPy and pandas (Python Data Analysis Library) allow you to read/manipulate data efficiently and easily.
  2. Matplotlib allows you to create useful and powerful data visualizations. I have also listed more data visualization packages in Python: Yilun (Tom) Zhang's answer to What's some good python data visualization website?
  3. Scikit-learn allows you to train and apply machine learning algorithms to your data and make predictions.
  4. Cython allows you to convert your code and run them in C environment to largely reduce the runtime and improve your model performance.
  5. PyMySQL allows you to easily connect to MySQL database, execute queries and extract data.
  6. BeautifulSoup to easily read in XML and HTML type data which is quite common nowadays.
  7. iPython notebook for interactive programming as in R.
  8. Multi-paradigm. You can write object-oriented and functional code.
  9. Interactiveness. Thanks to iPython and Jupyter notebooks. 
  10. A strong community
  11. Scripting powers. Dealing with thousands of files, scrapping websites, requesting different APIs..

Python’s increase in the share over 2015 rose by 51% demonstrating its influence as a popular data science tool.It is perfect when data analysis tasks involve integration with web apps or when there is a need to incorporate statistical code into the production database. The full-fledged programming nature of Python makes it a perfect fit for implementing algorithms.

This is fantastic, and opens up the door to do very creative and powerful things. That's all about why choose Python So Powerful for Data Science.If any comments on this post let me know.. 




Thursday, October 19, 2017

Python Vs Java which is best for Project

One of the most frequently asked question is should I learn Java or Python, Is Python is good programming language to start with, Which programming language would you recommend for beginners to learn first etc.Python and Java are two very different programming languages, but both can be useful tools for modern developers.

Most programmers agree that Python is an easier language for novice programmers to learn. You will progress faster if you are learning Python as a first language than Java. However, the popularity of Java means that learning this powerful language is essential if you want to develop apps for Android.

The great advantage of Java is that it can be used to create platform-independent applications. Any computer or mobile device that is able to run the Java virtual machine can run a Java application, whereas to run Python programs you need a compiler that can turn Python code into code that your particular operating system can understand. Thanks to the popularity of Java for web applications and simple desktop programs, most devices already have the Java virtual machine installed, so a Java programmer can be confident that their application will be usable by almost all users. The disadvantage of running inside a virtual machine is that Java programs run more slowly than Python programs.

One of the biggest differences between Python and Java is the way that each language handles variables. Java forces you to define the type of a variable when you first declare it and will not allow you to change the type later in the program. This is known as static typing. In contrast, Python uses dynamic typing, which allows you to change the type of a variable, by replacing an integer with a string, for example.

Dynamic typing is easier for the novice programmer to get to grips with, because it means you can just use your variables as you want to without worrying too much about their types. However, many developers would argue that static typing reduces the risk of undetected errors plaguing your program. When variables do not need to be explicitly declared before you use them, it is easy to misspell a variable name and accidentally create a whole new variable.

java’s speed allows it to outperform other languages and frameworks, which is a big part of why it’s so well suited to large-scale applications. These performance gains are what prompted Twitter to shift its search engine to Java from Ruby on Rails and move more of its back-end stack to the Java Virtual Machine.

Another key component of Java is that it comes as close to being 100% object-oriented as you can get. With that comes all the benefits of object-oriented programming, from ease of development to modular software to flexibility and extensibility. As one of the most widely known programming languages, it’s easy to find and hire talented developers. What’s more, Java’s massive community of developers means that there’s lots of excellent documentation around.

Like Java, Python is built to handle high-traffic sites. It’s fast and efficient, with an emphasis on code readability. Python’s motto is “there should be one—and preferably only one—obvious way to do it.” That can mean there’s a bit of a learning curve as developers learn the ins and outs of Python syntax, but the upside is an ability to express concepts with fewer lines of code than would be possible in languages like C++ or Java.

Python’s other great strength is an extensive set of libraries that allow it to perform a wide array of tasks. In particular, the libraries NumPy and matplotlib enable Python to perform many of the analysis and plotting functionalities of MATLAB. These libraries have since been built upon by a number of other libraries that extend Python’s functionality even further.




High Paying Jobs after Learning Python

Everyone knows Python is one of the most demand Programming Language. It is a computer programming language to build web applications and sc...