scipy problem