#Python

Tags: 28 posts

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 …
December 23, 2018 1 min read

Read data into pandas

Provide column names while reading a dataset in pandas # Import the required modules import pandas as pd Reading the dataset using read.csv() function with mentioning column names in names parameters. #Fetching data from url as csv by mentioning …
December 22, 2018 1 min read

Connect to azure storage (blob) using python

The following code snippets are on creating a connection to Azure Blob Storage using Python with account access key. For more details on Azure Blob Storage and generating the access key, visit : …
December 20, 2018 2 min read

Connect to azure datalake store using python

The following code snippets are on creating a connection to Azure Data Lake Storage Gen1 using Python with Service-to-Service authentication with client secret and client id. Follow the link, for more details on different ways to connect to Azure …