Using graph-based features with pandas and scikit-learn