Tag Archives: python

Data Structures and Algorithms in Python – Graphs

Graph Implementation – Adjacency list We’ve used dictionaries to implement the adjacency list in Python which is the easiest way. To implement Graph ADT we’ll create two classes, Graph, which holds the master list of vertices, and Vertex, which will represent each vertex in the graph. Each Vertex uses a dictionary to keep track of… Read More »

Implemeting Data Structures and Algorithms in Python: Problems and solutions

Recently I have started using Python in a lot of places including writing algorithms for MI/data science,  so I thought to try to implement some common programming problems using data structures in Python. As I have mostly implemented in C/C++ and Perl. Let’s get started with a very basic problem. Anagram algorithm An algorithm will… Read More »

Choropleth Maps in Python

Choropleth maps are a great way to represent geographical data. I have done a basic implementation of two different data sets. I have used jupyter notebook to show the plots. World Power Consumption 2014 First do Plotly imports import plotly.graph_objs as go from plotly.offline import init_notebook_mode,iplot init_notebook_mode(connected=True) Next step is to fetch the dataset, we’ll use… Read More »

Web development: LAMP: which programming languages should be used: Some thoughts

Now a days people keep asking which technology stack to be used for web development (LAMP, Java, Microsoft) and finally which programming language mainly server-side. Most of the expert says that use whichever you like and comfortable and I totally agree. If you intend to use Java and Microsoft based env then you don’t have… Read More »

Switching from Perl to Python: Speed

A real time comparison. Long live Perl.   http://silicainsilico.wordpress.com/2012/03/26/switching-from-perl-to-python-speed/   Update: Adding another comparison between various programming languages including Perl. This is bit old post but still relevant. http://tenser.typepad.com/tenser_said_the_tensor/2006/08/python_vs_perl_.html   Don’t forget to read comments.