Android Asynchronous Http Client

Motivation In Android it is highly inadvisable to do heavy lifting in the UI thread. When you even try to do some networking stuff like fetching images from a web server you might get an android.os.NetworkOnMainThreadException I’ve also written about it here To work around this issue you can use a third party library like…

New Blog Post

k-fold crossvalidation with sklearn

from sklearn.model_selection import KFold kf = KFold(n_splits=2) kf.split(df_train) step = 0 # set counter to 0 for train_index, val_index in kf.split(df_train): # for each fold step = step + 1 # update counter print(‘Step ‘, step) features_fold_train = df_train.iloc[train_index, [4, 5]] # features matrix of training data (of this step) features_fold_val = df_train.iloc[val_index, [4, 5]]…

pytest Tutorial – Part 3

Having your tests in place after reading pytest Tutorial – Part 1 and pytest Tutorial – Part 2 you certainly want to know how much of your code is actually tested by your tests. This is called coverage. Installation pip install pytest-cov Checking the coverage

pytest Tutorial – Part 2

In my last article pytest Tutorial Part 1  I showed some basic concepts of testing with pytest. Here are two additional concepts Parameterize Test parameterization follows the concept of DRY – Don’t repeat yourself Instead of writing a new testcase for every different value you annotate your test function and handover the different values. The…

Pandas Cheat Sheet

If you are new to Pandas feel free to read Introduction to Pandas I’ve assembled some pandas code snippets Reading Data Reading CSV import pandas as pd # read from csv df = pd.read_csv(“path_to_file”) Can also be textfiles. file suffix is ignored

Data Science Pipeline

Motivation Learning Data Science can be grueling and overwhelming sometimes. When I feel too overwhelmed it’s time to draw a picture. This my current overview of what a data scientist has to do: General tools Linear Algebra with numpy – Part 1 numpy random choice Numpy linspace function Data acquisiton Data Science Datasets: Iris flower…