[SciPy-User] numpy I/O question

Matwey V. Kornilov matwey.kornilov at gmail.com
Sun Jan 2 10:29:14 EST 2011


Hi,

I need help with NumPy I/O. I have specific array format in my input text 
data. Due to bug in data-producing software the negative values are 
concatenated to the previous values. (i.e. "1.0-3.4 3.1"). It was not 
critical for me because oddly enough this code in C++ parses it for me:

#include <iostream>

int main(){
	double a;
	double b;
	
	std::cin >> a >> b;
	std::cout << "a=" << a << " b=" << b << std::endl;

	return 0;
}

It is because operator>>(double) stops before "-" char and the second 
operator>>(double) runs from this position.

The question is how to get the same behaviour for NumPy I/O?





More information about the SciPy-User mailing list