0

When I try to read a .txt file using pandas the output I get is all the rows and columns with NaN. The text file has multiple delimiters.

I tried sep = 's+' and sep '\t' and still I get NaN for all the values.

Output:

example output

Input: example input

BML91
  • 2,952
  • 3
  • 32
  • 54
Mayur
  • 11
  • 2
  • Can you give an example input file and some simple code showing the problem? – Paul Rooney Mar 06 '19 at 22:45
  • Welcome to SO, please show how you are you loading this data as well as a sample of the data. – Jab Mar 06 '19 at 22:46
  • 2
    Possible duplicate of [import text to pandas with multiple delimiters](https://stackoverflow.com/questions/26551662/import-text-to-pandas-with-multiple-delimiters) – Jab Mar 06 '19 at 22:48
  • df = pd.read_csv("file location url",names=['a','b','c','d','e','f','g','h','i'], sep= '\s+') – Mayur Mar 06 '19 at 23:28
  • Can someone help me read the input using pandas ? – Mayur Mar 08 '19 at 21:11

0 Answers0