Blog

June 10, 2019 1 min read

Connect to azure datalake store using R

The following code snippets are on creating a connection to Azure Data Lake Storage Gen1 using R with Service-to-Service authentication with client secret and client id using REST API. Follow the link, for more details on different ways to connect …
May 30, 2019 1 min read

Business Days with Custom Holidays

Importing Packages and Datasets import pandas as pd start_date = ['2019-06-03', '2019-06-13', '2019-10-01', '2019-09-01'] end_date = ['2019-08-31', '2019-06-21', '2019-10-25', …
May 30, 2019 4 min read

Months between two dates

Importing Packages and Datasets import pandas as pd import numpy as np start_date = ['2019-06-03', '2019-06-13', '2018-11-05', '2019-05-31', '2019-06-01', '2019-09-01'] end_date = …
April 23, 2019 1 min read

Applying functions over pandas dataframe using apply, applymap and map

Importing Packages and Datasets import pandas as pd import numpy as np data = pd.DataFrame(np.random.rand(4, 3)*100, columns=['Physics','Çhemistry','Maths'], index = ['Student 1', 'Student 2','Student …
April 3, 2019 2 min read

Filtering using mask and where in pandas

Filtering a dataframe can be achieved in multiple ways using pandas. There are times when you simply need to update a column based on a condition which is true or vice-versa. In pandas dataframe there are some inbuilt methods to achieve the same …
March 28, 2019 2 min read

String Interpolation in Python

String operations in python, sometimes can be a bit tedious, specially when we need to pass variables within Strings. Although there are multiple ways to achieve the same, but some of the them are String interpolation str.format() Declaring some …
March 25, 2019 5 min read

Join, Merge, Append and Concatenate

Working with multiple data frames often involves joining two or more tables to in bring out more no. of columns from another table by joining on some sort of relationship which exists within a table or appending two tables which is adding one or …
January 7, 2019 3 min read

Attributes, Methods and Functions in python

Understand the concept of attributes, methods and functions under the context of a dataframe Attributes Attributes are the features of any object. They can be accessed by following a dot and the name of the following attribute. For example: …
January 5, 2019 2 min read

Subsetting a dataframe in pandas

Importing packages and datasets import pandas as pd # Fetching data from url as csv by mentioning values of various paramters data = pd.read_csv("https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data", header = None, …
January 1, 2019 5 min read

Indexing and Sorting a dataframe using iloc and loc

There are multiple ways in pandas by which a dataframe can be indexed i.e, selecting particular set of rows and columns from a dataframe. For a detailed description over this topic, once can refer official pandas documentation - Indexing and …