Reputation: 894
I'm having a problem with loading a data file in python. The error that I'm getting is
datasim = loadtxt("/home/ddrek/Dust/ppc/1925.txt")
^
SyntaxError: invalid syntax
Here is the code:
from numpy import *
import matplotlib.pyplot as plt
import pylab
data = loadtxt("/home/di/DI/ic/da/flash/oux.19_"+str(DOM))
d, t, q = data[:,1], data[:,2], data[:,3]
d, t, q = loadtxt("/home/di/DI/ic/da/flash/oux.19_"+str(DOM), usecols = #(1,2,3), unpack=True)
datasim = loadtxt("/home/ddrek/Dust/ppc/1925.txt")
Thanks!
Upvotes: 1
Views: 753
Reputation: 34146
Remove the #
character from:
d, t, q = loadtxt("/home/di/DI/ic/da/flash/oux.19_"+str(DOM), usecols = #(1,2,3), unpack=True)
because #
is used to make comments in Python.
You may also want to edit your code if it is required.
Upvotes: 3