My data can have some erroneous rows which contain less columns. How can I skip these rows when I load the data using loadtxt
such that it continues instead of throwing an error?
Example:
Data in file=
0 4.5 523.1 2.2 432123.5
1 4.21 529.5 3.4 432122.3
2 4.15 526.2 4.6 432122.6
3 4.54 523.7
4 4.65 527.5 5.0 432121.8
5 4.75 521.4 5.0 432121.1
Resulting imported data should be the data from the file without the erroneous row:
0 4.5 523.1 2.2 432123.5
1 4.21 529.5 3.4 432122.3
2 4.15 526.2 4.6 432122.6
4 4.65 527.5 5.0 432121.8
5 4.75 521.4 5.0 432121.1