NK Series in python