add the parameter dropna to the function to_dict.
this is necessary because you cant reach the same effect by just using
dropna().to_dict() also see
http://stackoverflow.com/questions/26033301/make-pandas-dataframe-to-a-dict-and-dropna/26033302#26033302