I am trying to plot a histogram with this code. Python is giving me an error in line 1.
numpy.genfromtxt('dataset1.txt', dtype=<type 'float'>,
comments='#', delimiter=None, skip_header=0,
skip_footer=0, missing_values=None,
filling_values=None, usecols=None, unpack=None)
plt.errorbar(x,y, yerr=yErr)
ls='',marker='.'
errorevery=n
numpy.polyfit(x,y,degr,w=None)
plt.xlabel('An arbitrary x-value')
plt.ylabel('A Gaussian y-value')
plt.title('One fine Gaussian')
The first line produces:
syntax errormeans it fails the first step, reading the string and figuring what it is in basic python terms. Note the tick,^under '<type...>'. This isn't valid python notation. As comments say, it's a documenation way of saying put something like 'float' or 'int' here.Sooner of later you need to learn basic python, and how to read documenation of functions like this.
AND write SO questions with enough information.