Added Python scripts

Added Python libraries

fixed a bug when extracting measurements from the database. Training now goes much smoother, but there is still some weirdness.

f