Python and CSV – Working With Excel Spreadsheets In Python

We are all familiar with Excel spreadsheets. They are used everywhere to make tables and keep track of stuff in general. Excel offers nice functionalities as well. When we are dealing with a huge number of entries, manipulating these values manually becomes tedious. Consider a situation where there are 1000 rows and 25 columns in a spreadsheet. You want to check the values in the 8th column of each row. Depending on those values, you want to manipulate the values in the 17th column of each row. Or perhaps we want to get all the rows with the same name together. If it were a few rows and columns, we could have done it manually. But doing this for 1000 rows is quite boring. So how do we do it?   Continue reading “Python and CSV – Working With Excel Spreadsheets In Python”

Kernel Functions For Machine Learning

You must have heard the term ‘kernel’ floating around quite a few times. People from many different backgrounds use it in different contexts. The thing is that this term has been applied to different things in different domains. When we talk about operating systems, we talk about which kernel is being used. Kernel is also used extensively in parallel computing and in the GPU domain, where it is the function which is called repetitively on a computing grid. It has a few other meanings in different hardware related programming fields. But in this post, I will discuss kernels as applied to machine learning. Kernels are used in machine learning to transform the data so that the classification becomes easier. One common thing in all these different definitions of the term ‘kernel’ is that it is being used as a bridge between two things. In operating systems, it is the bridge between hardware and software. In GPU domain, it is the bridge between the geometric grid and the programmer. In machine learning, it is the bridge between linearity and non-linearity. I will discuss the underlying mathematical structure in this post. So readers beware, this is a technical deep-dive.   Continue reading “Kernel Functions For Machine Learning”

Command Line Within Python

One of the cool things about Python is that you can do absolutely anything and everything with it. This blog post deals with using command line within Python. When you are writing your code in Python, you might want to access the command line to run a couple of commands like ls, grep, make etc. If it were a shell script, you could directly write that command and it will get executed as if you were on the command line. But shell scripting will only provide limited functionalities. So how do we do it in Python?   Continue reading “Command Line Within Python”

What Is SSH?

Consider the following situation. You are at your friend’s place with your laptop and you want to access your home computer to do something. May be you want to start a download or you want to run a program right away. What would you do in this situation? Will you go all the way to your house just to start a download? You already have a laptop at your disposal, so you should be able to use it somehow. You can just connect to your home computer through internet. But what if someone else hacks you while you do that? This is where SSH comes in.   Continue reading “What Is SSH?”

Support Vector Machines

In machine learning, we have supervised learning on one end and unsupervised learning on the other end. Support Vector Machines (SVMs) are supervised learning models used to analyze and classify data. We use machine learning algorithms to train the machines. Once we have a model, we can classify unknown data. Let’s say you have a set of data points and they belong one of the two possible classes. Now our task is to find the best possible way to put a boundary between the two sets of points. When a new point comes in, we can use this boundary to decide whether it belongs to class 1 or class 2. In real life, these data points can be a set of observations like images, text, characters, protein sequences etc. How can we achieve this in the most optimal way?   Continue reading “Support Vector Machines”

Quantum Computer

We are always hungry for more processing power. Whenever we buy computers, we always look for the ones with higher configuration. The computer manufacturers thrive to give us more speed and processing power at lower costs so that they can differentiate themselves from their competitors. With the emergence of so many technologies, our need for processing power is increasing by the day. Moore’s law states that the number of transistors on a microprocessor will double every 18 months. This law has been more or less true up until now but it is getting saturated. So we need to look into a different direction if we want to keep up. Quantum computers can perform calculations significantly faster than silicon-based computer. So what are quantum computers? How can they perform calculations so quickly?   Continue reading “Quantum Computer”

Panoramic Images


Consider a situation where you are standing on top of a mountain or some other beautiful natural scenery. You are enjoying a beautiful view that seems to span from far left to far right and you want to take a nice picture of the whole thing. Your camera allows you to capture only a limited field of view. So to capture the whole scene, you will have to capture multiple images. Doesn’t feel exactly the same watching it in pieces, does it? We really want to capture the beauty within a single image. You can certainly record a video and capture the whole scene, but what if you want to print it out? This is where panoramic photography technique comes in. Panoramic images are images with elongated field of view. The image above is one such example. These images cannot be captured with a single camera click because the field of view is limited. So how do we do capture panoramic images?   Continue reading “Panoramic Images”

Artificial Neural Networks

We want our machines to learn everything on their own as much as possible. Over the past few decades, researchers have come up with many theories and formulations about how we can achieve this in the best possible way. This realm is called machine learning. We come up with algorithms to teach the machines how to learn. I have discussed more about machine learning here. Human brain seems to achieve this rather effortlessly. Our ultimate goal is to make the machines as good as our brains, or even better. The formulation of Artificial Neural Network (ANN) is an attempt towards this.   Continue reading “Artificial Neural Networks”

Automatic Downloading

Let’s say you are surfing the web and you come across a cool website with a great collection of pictures. Some of them are located on that page and many more can be reached through various links on that page. There are hundreds of pictures and you want to download all of them. How would you do it? Would you click and save each image separately? Let’s say you really like the design of that site and you want to download the whole thing along with the source code. How would you do it automatically without wasting time?   Continue reading “Automatic Downloading”

Optimal Solution Concept

Do you remember Adam Smith? He is considered the father of modern economics. His theories were used for more than 150 years by governments, industries, banks etc. One of his famous laws states that people act in their own self-interest. He postulated that in a free market, you will have to compete to survive. He explained how rational self-interest and competition can lead to economic prosperity. Is this always true? Can you think of a case where this theory might not lead us to the most optimal solution? This is not a philosophical discussion, so I actually want you take a minute and think. If people are competing against each other, then what strategy would lead to the most optimal overall result.   Continue reading “Optimal Solution Concept”