Linked Questions

Popular Questions

Reading a .dat with 1's and 0's returns something very weird

Asked by At

I have a .dat file that consists of a single row in the format:

[1,0,0,0,0,0,0,1,0,...]

When I use read_csv("data.dat"), it turns into:

[1, 0, 0.1, 0.2, 0.3, 0.5, 1.1, 0.6,...]

And they are all in index, thus I can't work with them.

How do I go about reading the .dat file so that the dataframe would be in the same format as the .dat file?

Image: How it looks like on Spyder IDE

Related Questions