Get ready-to-use Data Science code snippets created by industry experts
iPython Notebook
Download the iPython notebook for 100+ code snippets.
Explanations
Code snippets include helpful explanations to understand the code logic.
Detailed Coverage
Deep coverage of various data science topics needed for real industry projects.
Select Category
CODE SNIPPET CATEGORY DATE MODIFIED
How to rank a Pandas DataFrame? DataFrame and Pandas in Python,rank, pandas, dataframe Aug 17, 2019
How to randomly sample a Pandas DataFrame? DataFrame and Pandas in Python,randomly, sample, pandas, dataframe Aug 17, 2019
How to format string in a Pandas DataFrame Column? DataFrame and Pandas in Python,format, string, pandas, dataframe, column Aug 17, 2019
How to create Pivot table using a Pandas DataFrame? DataFrame and Pandas in Python,pivot, table, using, pandas, dataframe Aug 17, 2019
How to Normalise a Pandas DataFrame Column? DataFrame and Pandas in Python,normalise, pandas, dataframe, column Aug 17, 2019
How to calculate MOVING AVG in a Pandas DataFrame? DataFrame and Pandas in Python,calculate, moving, avg, pandas, dataframe Aug 17, 2019
How to deal with missing values in a Pandas DataFrame? DataFrame and Pandas in Python,deal, with, missing, values, pandas, dataframe Aug 17, 2019
How to map values in a Pandas DataFrame? DataFrame and Pandas in Python,map, values, pandas, dataframe Aug 17, 2019
How to list unique values in a Pandas DataFrame? DataFrame and Pandas in Python,list, unique, values, pandas, dataframe Aug 17, 2019
How to JOIN and MERGE Pandas DataFrame? DataFrame and Pandas in Python,join, and, merge, pandas, dataframe Aug 17, 2019
How to present Hierarchical Data in Pandas? DataFrame and Pandas in Python,present, hierarchical, data, pandas Aug 17, 2019
How to group rows in a Pandas DataFrame? DataFrame and Pandas in Python,group, rows, pandas, dataframe Aug 17, 2019
How to find the largest value in a Pandas DataFrame? DataFrame and Pandas in Python,find, largest, value, pandas, dataframe Aug 17, 2019
How to filter in a Pandas DataFrame? DataFrame and Pandas in Python,filter, pandas, dataframe Aug 17, 2019
How to drop ROW and COLUMN in a Pandas DataFrame? DataFrame and Pandas in Python,drop, row, and, column, pandas, dataframe Aug 17, 2019
How to get descriptive statistics of a Pandas DataFrame? DataFrame and Pandas in Python,get, descriptive, statistics, of, pandas, dataframe Aug 17, 2019
How to delete duplicates from a Pandas DataFrame? DataFrame and Pandas in Python,delete, duplicates, pandas, dataframe Aug 17, 2019
How to create crosstabs from a Dictionary in Python? DataFrame and Pandas in Python,crosstabs, dictionary Aug 17, 2019
How to create a new column based on a condition in Python? DataFrame and Pandas in Python,new, column, based, on, condition Aug 17, 2019
How to insert a new column based on condition in Python? DataFrame and Pandas in Python,insert, new, column, based, on, condition Aug 07, 2019
How to convert string variables into DateTime variables in Python? DataFrame and Pandas in Python,convert, string, variables, into, datetime, variables Aug 07, 2019
How to convert string categorical variables into numerical variables using Label Encoder? DataFrame and Pandas in Python,convert, string, categorical, variables, into, numerical, variables, using, label, encoder Aug 07, 2019
How to convert string categorical variables into numerical variables in Python? DataFrame and Pandas in Python,convert, string, categorical, variables, into, numerical, variables Aug 07, 2019
How to convert categorical variables into numerical variables in Python? DataFrame and Pandas in Python,convert, categorical, variables, into, numerical, variables Aug 07, 2019
How to preprocess string data within a Pandas DataFrame? DataFrame and Pandas in Python,preprocess, string, data, within, pandas, dataframe Aug 07, 2019
How to apply arithmatic operations on a Pandas DataFrame? DataFrame and Pandas in Python,apply, arithmatic, operations, on, pandas, dataframe Aug 07, 2019
How to assign a new column in a Pandas DataFrame? DataFrame and Pandas in Python,assign, new, column, pandas, dataframe Aug 07, 2019
How to do Data Analysis in a Pandas DataFrame? DataFrame and Pandas in Python,do, data, analysis, pandas, dataframe Aug 07, 2019
How to apply functions in a Group in a Pandas DataFrame? DataFrame and Pandas in Python,apply, functions, group, pandas, dataframe Aug 07, 2019
How to deal with an Item in a List in Python? Data Preprocessing in Python,deal, with, item, list Aug 07, 2019
How to convert Strings to DateTimes in Python? Data Preprocessing in Python,convert, strings, datetimes Aug 07, 2019
How to select DateTime within a range in Python? Data Preprocessing in Python,datetime, within, range Aug 07, 2019
How to deal with Rolling Time Window in Python? Data Preprocessing in Python,deal, with, rolling, time, window Aug 07, 2019
How to introduce LAG time in Python? Data Preprocessing in Python,introduce, lag, time Aug 07, 2019
How to deal with missing values in a Timeseries in Python? Data Preprocessing in Python,deal, with, missing, values, timeseries Aug 07, 2019
How to encode Days of a week in Python? Data Preprocessing in Python,encode, days, of, week Aug 07, 2019
How to calculate difference between Dates in Python? Data Preprocessing in Python,calculate, difference, between, dates Aug 07, 2019
How to split DateTime Data to create multiple feature in Python? Data Preprocessing in Python,split, datetime, data, multiple, feature Aug 07, 2019
How to standardise IRIS Data in Python? Data Preprocessing in Python,standardise, iris, data Aug 07, 2019
How to standardise features in Python? Data Preprocessing in Python,standardise, features Aug 03, 2019
How to rescale features in Python? Data Preprocessing in Python,rescale, features Aug 03, 2019
How to process categorical features in Python? Data Preprocessing in Python,process, categorical, features Aug 03, 2019
One hot Encoding with nominal categorical features in Python? Data Preprocessing in Python,one, hot, encoding, with, nominal, categorical, features Aug 03, 2019
One hot Encoding with multiple labels in Python? Data Preprocessing in Python,one, hot, encoding, with, multiple, labels Aug 03, 2019
How to impute missing values with means in Python? Data Preprocessing in Python,impute, missing, values, with, means Aug 03, 2019
How to deal with outliers in Python? Data Preprocessing in Python,deal, with, outliers Aug 03, 2019
How to deal with imbalance classes with upsampling in Python? Data Preprocessing in Python,deal, with, imbalance, classes, with, upsampling Aug 03, 2019
How to deal with imbalance classes with downsampling in Python? Data Preprocessing in Python,deal, with, imbalance, classes, with, downsampling Aug 03, 2019
How to encode ordinal categorical features in Python? Data Preprocessing in Python,encode, ordinal, categorical, features Aug 03, 2019
How to find outliers in Python? Data Preprocessing in Python,find, outliers Aug 03, 2019
How to delete instances with missing values in Python? Data Preprocessing in Python,delete, instances, with, missing, values Aug 03, 2019
How to impute missing class labels using nearest neighbours in Python? Data Preprocessing in Python,impute, missing, class, labels, using, nearest, neighbours Aug 03, 2019
How to impute missing class labels in Python? Data Preprocessing in Python,impute, missing, class, labels Aug 03, 2019
How to convert Categorical features to Numerical Features in Python? Data Preprocessing in Python,convert, categorical, features, numerical, features Aug 03, 2019
How to prepare a machine learning workflow in Python? Data Preprocessing in Python,prepare, machine, learning, workflow Aug 03, 2019
How to Create simulated data for clustering in Python? Data Preprocessing in Python,simulated, data, for, clustering Aug 03, 2019
How to Create simulated data for classification in Python? Data Preprocessing in Python,simulated, data, for, classification Aug 03, 2019
How to Create simulated data for regression in Python? Data Preprocessing in Python,simulated, data, for, regression Aug 03, 2019
How to load sklearn Boston Housing data? Data Preprocessing in Python,load, sklearn, boston, housing, data Aug 03, 2019
How to load features from a Dictionary in python? Data Preprocessing in Python,load, features, dictionary Aug 02, 2019
How to add and subtract between matrices? Data Preprocessing in Python,add, and, subtract, between, matrices Aug 02, 2019
How to Divide each element of a matrix by a numerical value? Data Preprocessing in Python,divide, each, element, of, matrix, by, numerical, value Aug 02, 2019
How to MULTIPLY numerical value to each element of a matrix? Data Preprocessing in Python,multiply, numerical, value, each, element, of, matrix Aug 02, 2019
How to SUBTRACT numerical value to each element of a matrix? Data Preprocessing in Python,subtract, numerical, value, each, element, of, matrix Aug 02, 2019
How to ADD numerical value to each element of a matrix? Data Preprocessing in Python,add, numerical, value, each, element, of, matrix Aug 02, 2019
How to calculate dot product of two vectors? Data Preprocessing in Python,calculate, dot, product, of, two, vectors Aug 02, 2019
How to find Maximum and Minimum values in a Matrix? Data Preprocessing in Python,find, maximum, and, minimum, values, matrix Aug 02, 2019
How to find the Rank of a Matrix? Data Preprocessing in Python,find, rank, of, matrix Aug 02, 2019
How to Calculate Mean, Variance and Std of a Matrix or ndArray? Data Preprocessing in Python,calculate, mean,, variance, and, std, of, matrix, ndarray Aug 02, 2019
How to create RANDOM Numbers in Python? Data Preprocessing in Python,random, numbers Aug 02, 2019
How to define WHILE Loop in Python? Data Preprocessing in Python,define, while, loop Aug 02, 2019
How to define FOR Loop in Python? Data Preprocessing in Python,define, for, loop Aug 02, 2019
How to find MIN, MAX in a Dictionary? Data Preprocessing in Python,find, min,, max, dictionary Aug 02, 2019
How to deal with Dictionary Basics in Python? Data Preprocessing in Python,deal, with, dictionary, basics Aug 02, 2019
How to deal with Date & Time Basics in Python? Data Preprocessing in Python,deal, with, date, &, time, basics Aug 02, 2019
How to Create and Delete a file in Python? Data Preprocessing in Python,and, delete, file Aug 02, 2019
How to convert STRING to DateTime in Python? Data Preprocessing in Python,convert, string, datetime Aug 02, 2019
How to use CONTINUE and BREAK statement within a loop in Python? Data Preprocessing in Python,use, continue, and, break, statement, within, loop Aug 02, 2019
How to do numerical operations in Python using Numpy? Data Preprocessing in Python,do, numerical, operations, using, numpy Aug 02, 2019
How to Flatten a Matrix? Data Preprocessing in Python,flatten, matrix Jul 30, 2019
How to Calculate Determinant of a Matrix or ndArray? Data Preprocessing in Python,calculate, determinant, of, matrix, ndarray Jul 30, 2019
How to calculate Diagonal of a Matrix? Data Preprocessing in Python,calculate, diagonal, of, matrix Jul 30, 2019
How to Calculate Trace of a Matrix? Data Preprocessing in Python,calculate, trace, of, matrix Jul 30, 2019
How to invert a matrix or nArray in Python? Data Preprocessing in Python,invert, matrix, narray Jul 30, 2019
How to convert a dictionary to a matrix or nArray in Python? Data Preprocessing in Python,convert, dictionary, matrix, narray Jul 30, 2019
How to reshape a Numpy array in Python? Data Preprocessing in Python,reshape, numpy, array Jul 30, 2019
How to select elements from Numpy array in Python? Data Preprocessing in Python,elements, numpy, array Jul 30, 2019
How to create a sparse Matrix in Python? Data Preprocessing in Python,sparse, matrix Jul 30, 2019
How to Create a Vector or Matrix in Python? Data Preprocessing in Python,vector, matrix Jul 30, 2019
How to find correlations among feature variables in R? Data Science,correlations,feature variables, r Jul 24, 2019
How to use auto encoder for unsupervised learning models? Data Science,auto encoder, unsupervised learning models, pytorch Jul 24, 2019
How to visualise regression analysis in R? Data Science,visualise, regression, regression analysis in r Jul 24, 2019
How to run a basic RNN model using Pytorch? Data Science,run basic RNN, RNN, RNN model, Pytorch Jul 24, 2019
How to save and reload a deep learning model in Pytorch? Data Science,Pytorch, Deep Learning, save models Jul 24, 2019
Ready-to-use code
Release your projects faster by plugging-in one of our reusable code snippets.
Top industry experts
Learn and get hands-on experience with latest project solutions from industry experts.
Unlimited access
Stay updated with free access to new recipes being launched every week.