import numpy as np
import matplotlib.pyplot as plt
data = np.loadtxt('data.dat')
x1 = data[:, (0)]
y1 = data[:, (1)]
plt.plot(x1, y1)
plt.show()
error with reading float from two column text file into an array in Python