Checking test coverage with pytest-cov

Test coverage

I wanted to analyze my python package flaskurls for test coverage. this is how you can do it:

pipenv install pytest-cov
py.test --cov=flask_url_mapping tests/
----------- coverage: platform win32, python 3.6.5-final-0 -----------
Name                              Stmts   Miss  Cover
-----------------------------------------------------
flask_url_mapping\__init__.py         1      0   100%
flask_url_mapping\flask_urls.py      73      0   100%
-----------------------------------------------------
TOTAL                                74      0   100%


========================== 10 passed in 0.60 seconds ==========================

10 things I didn’t know about Data Science a year ago

In my article My personal road map for learning data science in 2018 I wrote about how I try to tackle the data science knowledge sphere. Due to the fact that 2018 is slowly coming to an end I think it is time for a little wrap up.

What are the things I learned about Data Science in 2018? Here we go:

1. The difference between Data Science, Machine Learning, Deep Learning and AI

Continue reading “10 things I didn’t know about Data Science a year ago”

Distributing your own package on PyPi

In Regular Expressions Demystified I developed a little python package and distributed it via PyPi.

I wanted to publish my second self-written package as well, but coming back after almost a year, some things have changed in the world of PyPi, i.e. the old tutorials aren’t working anymore.

So I wrote this article to bring some clarity into this topic.

Distutils vs Setuptools

Continue reading “Distributing your own package on PyPi”

Lesson 10: Feature Scaling

What is Feature Scaling?

Feature Scaling is an important pre-processing step for some machine learning algorithms.

Imagine you have three friends of whom you know the individual weight and height.

You would like to deduce Chris’ T-shirt size from Cameron’s and Sarah’s by looking at the height and weight.

Name Height in m Weight in kg T-Shirt size
Sarah 1.58 52 Small
Cameron 1.79 79 Large
Chris 1.86 64 ?

One way You could determine the shirt size is to just add up the weight and the height of each friend. You would get: Continue reading “Lesson 10: Feature Scaling”

Differences in end of line characters

When You are working with different operating systems you encounter different line endings. Editing a file on a Linux system and opening it on a windows machine can give a weird result.

Here is a short overview which system uses which command characters:

OS Command character
Windows CR + LF
Linux LF
Mac OS <= 9 CR
Mac OS X LF