Make stats accept a dataframe

- had to fix utils because of buggy behaviour in matplotlib