Showing posts with label Python. Show all posts
Showing posts with label Python. Show all posts

Thursday, November 7, 2013

IPython introduction

Why do we need IPython?

The project IPython aims at making python more interactive. The default interactive python shell (what we get when by typing "python" ) is limited with functionality. For example, we can not explore files and directories (like "ls" command) or error messages with exploring files are not very informative. 

How to install?

Make sure you have PIP already setup which will help to install other libraries easily. If you don't have it then refer this.

> pip install ipython 


Wednesday, October 23, 2013

Python and Data Science

I was exploring Linkedin profiles of well known data scientists like Jeff Hammerbacher,  Hilary Mason, DJ Patil, Gilad Lotan to get the idea about their technical skill-set. The first common thing I could find was Python. So I decided to explore about general projects and data mining/ machine learning libraries associated with Python.

General Python Projects:

Python: A general purpose high-level programming language. Python supports multiple programming paradigms, like object-oriented, imperative and functional programming or procedural styles. [1] Python implementation is under open source license that makes it freely usable and distributable, even for commercial use. [2]
Created by: Guido van Rossum

Thursday, October 3, 2013

Parse JSON using Python and store in MySQL

JSON is one the most widely used data format. If you are trying to gather some data using any API then most probably you are going to deal with JSON. Lets see how to parse JSON and get specific parameter values.

Python has a library called "json" which will helps us to deal with the json data. Also we can use the "pprint" which is "data pretty printer" to display formatted output. Generally we will have three main steps for this kind of task,
  • Read the JSON data
  • Store values in python variables
  • Store the data in some database

Tuesday, October 1, 2013

MySQL querying using Python

Python is one of the most preferred language of data scientists (according to kdnuggets). Before we dive deeper with machine learning and visualization packages lets explore the basics of relational database management using Python.


So there are few packages using which we can execute sql queries from python program. I guess the most widely used packages are MySQLdb and PyMySQL. The difference is in the implementation where MySQLdb is a C extension and PyMySQL is pure Python. However is terms of functionality both are almost same. However if you are on Mac then you might like to prefer PyMySQL as the MySQLdb might give some compiler issues.


Wednesday, February 6, 2013

Python: Building basic crawler with BeautifulSoup



As big data is becoming buzzword, every organization is trying hard to make the best out of data science. And the actual implementation starts from collecting right data. The data collection can be internal sources, from multiple business units or it can be from external sources required for marketing/sales units. There are many firms in market who collect lot of data from open sources/web and then sell specific and cleaned data to required companies. Due to many programming languages and libraries associated with them its not rocket science to collect this data. So lets discuss how can we build a simple crawler.

Wednesday, January 16, 2013

MySQL querying using Python

Python is one of the most preferred language of data scientists (according to kdnuggets). Before we dive deeper with machine learning and visualization packages lets explore the basics of relational database management using Python.

So there are few packages using which we can execute sql queries from python program. I guess the most widely used packages are MySQLdb and PyMySQL. The difference is in the implementation where MySQLdb is a C extension and PyMySQL is pure Python. However is terms of functionality both are almost same. However if you are on Mac then you might like to prefer PyMySQL as the MySQLdb might give some compiler issues.