Thursday, November 2, 2017

numpy ndarray


numpy ndarray is a n dimensional array. The array is a table of elements of same type. Let's go through some basic operations that we can do with ndarray

Wednesday, November 1, 2017

Pandas dataframe data manipulation


Python dataframe is a tabular structure and can be think like a spreadsheet. It provides a lot of functionality to play with data at column, row or individual data point level. 

Let's look into a jupyter python notebook about how the different data can be manipulated 

Tuesday, October 31, 2017

Pandas Dataframe data selection


Python dataframe is a tabular structure and can be think like a spreadsheet. It provides a lot of functionality to play with data at column, row or individual data point level. 

Let's look into a jupyter python notebook about how the different data can be displayed 

Monday, October 30, 2017

Reading csv and excel files in pandas dataframe

Dataframe can be used to load the data from various files. Let's look into how we can load the data from excel and csv.


Make sure the data file that you are loading is present in the given location. In my case, I will be assuming that the data file is present at the same location where python code is.

Code to load different files

Changing Jupyter configuration

If one wants to open Jupyter notebook on a different browser than it can be done by couple of ways outlined below

The first step is to generate the config file

jupyter notebook --generate-config

This generates the config file in home directory at home directory

Saturday, October 28, 2017

Initializing Pandas Dataframe

Dataframe can be initialized in multiple ways. Let's see some of the approaches below #createing dataframe with #list of countries, GDP and per capita countries_df = pd.DataFrame([["Germany",4.150,50206],
["India", 2.454, 7153],
["USA",18.558,57467]]) print(countries_df)

Sunday, October 8, 2017

Logging in Python using dynamic log file

Sometimes we need to send logs to a log file supplied dynamically. The standard mechanism of the python is to set the file as part of configuration. I will put down a way to do this.

Let's write a python file which captures the initialization of logger.

Let the file name be init-log.py