Loading data file with too many commas in Python
I don't know if this is an option but you could pre-process it using tr -s ',' file.txt. This is a shell command so you'd have to do it either before calling python or using system. The latter might not be the best way since dragon2fly solved the issue using a python function.
I am trying to collect some data from a .txt file into my python script. The problem is that when the data was collected, it could not collect data in one of the columns, which has given me more commas than normally. It looks like this:
0,0,,-2235
1,100,,-2209
2,200,,-2209
All I want is to load the data and remove the commas but when I try with numpy.loadtxt it gives me a value error. What do I do?