Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Seeing the nobody has given a smart answer to this question, here is just my stupid yet quick hadmade solution:

plot_list=[]
i=0
plot_list.append((X[i],Y[i]))
slope = 0
for i in range(1,len(X)):
    plot_list.append((X[i],Y[i]))
    slope += (Y[i]-Y[i-1])/(X[i]-X[i-1])

slope /= len(X)
print("Average slope = {0}".format(slope))

list_plot(plot_list)

Seeing the nobody has given a smart answer to this question, question so far, here is just my stupid yet quick hadmade solution:

plot_list=[]
i=0
plot_list.append((X[i],Y[i]))
slope = 0
for i in range(1,len(X)):
    plot_list.append((X[i],Y[i]))
    slope += (Y[i]-Y[i-1])/(X[i]-X[i-1])

slope /= len(X)
print("Average slope = {0}".format(slope))

list_plot(plot_list)

Seeing the nobody has given a smart answer to this question so far, here is just my stupid yet quick hadmade hand-made solution:

plot_list=[]
i=0
plot_list.append((X[i],Y[i]))
slope = 0
for i in range(1,len(X)):
    plot_list.append((X[i],Y[i]))
    slope += (Y[i]-Y[i-1])/(X[i]-X[i-1])

slope /= len(X)
print("Average slope = {0}".format(slope))

list_plot(plot_list)