I am new in Python, I was working on that problem, but I faced with many errors. Firstly, I have 3 excel files, I need to find the highest 3 values from the each excel. Then, I need to take mean value of the each 3 highest values. After that, I need to plot the mean values, name of the excels must be at Y-axis, and mean values must be at X-axis.
I had the maximum values and mean values without any error, but I need to contact them each other and get a graph. I wrote that codes, but it did not work. How can I fix the errors? Thank you.
import numpy as np
import xlrd
book = xlrd.open_workbook("inc.xlsx")
sheet = book.sheet_by_index(0)
def inc_follow_up():
col = 1
return max(sheet.col_values(col, start_rowx=2, end_rowx=1441)[:3])
def inc_avg():
sum(inc_follow_up()) / len(inc_follow_up())
import xlrd
book = xlrd.open_workbook('mok.xlsx')
sheet = book.sheet_by_index(0)
def mok_follow_up():
col = 1
return max(sheet.col_values(col, start_rowx=2, end_rowx=1441)[:3])
def mok_avg():
sum(mok_follow_up()) / len(mok_follow_up())
import xlrd
book = xlrd.open_workbook('sok.xlsx')
sheet = book.sheet_by_index(0)
def sok_follow_up():
col = 1
return max(sheet.col_values(col, start_rowx=2, end_rowx=1441)[:3])
def sok_avg():
sum(sok_follow_up()) / len(sok_follow_up())
plt.plot(inc_avg["Significant wave height (cm)"],inc, color='green', label="Inc")
plt.plot(mok_avg["Significant wave height (cm)"], mok, color='green', label="Mok")
plt.plot(sok_avg["Significant wave height (cm)"], sok, color='green', label="Sok")
plt.title("Free")
plt.ylabel("Significant wave height (cm)")
plt.xlabel("inc","mok","sok")
plt.legend()
plt.show()