Python
Explore our Python content
August 21, 2019
•
3 min read
Part 1 - Plotting Using Seaborn - Violin, Box and Line Plot
Introduction and Data preparation Please follow the folloing links regarding data preparation and previous posts to follow along -
For Data Preparation - Part 0 - Plotting Using Seaborn - Data …
August 20, 2019
•
3 min read
Part 0 - Plotting Using Seaborn - Data Preparation
Import Preliminaries and datasets import pandas as pd import seaborn as sns import matplotlib.pyplot as plt import matplotlib.pylab as plb import warnings warnings.filterwarnings('ignore') test_scores = …
July 20, 2019
•
2 min read
Nearest Neighbors using L2 and L1 Distance
Preliminaries Distance Matrics L2 Norm L1 Norm Nearest Neighbor Using L2 Distance Using L1 Distance Predictions Errors Confusion Matrix Using Pandas From Scratch Preliminaries import numpy as np # Load data set and code …
July 8, 2019
•
4 min read
Exception handling in Python
Try and Except Handle Exceptions Exceptions Attributes Handling Multiple Exceptions Else Finally Try and Except Handle Exceptions The following statement will throw an error as string can’t be parsed into …
June 29, 2019
•
3 min read
Functions in Python - return, scope, args and kwargs
Return in Function Scoping in Function Access global variable in function context Declare a local variable within in a function Declare local variable with same name as in global Using Global Keyword *args and **kwargs …
June 28, 2019
•
2 min read
Break, Continue and Pass in Python
Continue vs Break Continue print("The loop will skip the value when value of i is 2 and restart from next value of i - ") for i in range(0,4): if i == 2: continue else: print(i+100) Output: The loop will skip …
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'] …
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', …
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', …
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 …
About Python
This category contains all our posts about Python. Browse through to find what you’re looking for.
All Categories
37 posts