Python Error Invalid Value Encountered In Double Scalars