I try to convert these code below to script:
import pandas as pd
import numpy as np
num_job=10 # number of jobs
pt_tmp=pd.read_excel("JSP_dataset.xlsx",sheet_name="Processing Time",index_col =[0])
pt=[list(map(int, pt_tmp.iloc[i])) for i in range(num_job)]
to ExcelReadFile.py
import pandas as pd
class ExcelReadFile(object):
def __init__(self,fileName, num_job):
self.fileName = fileName
self.num_job = num_job
def processingTime(self, fileName, num_job):
pt_tmp=pd.read_excel(fileName,sheet_name="Processing Time", index_col =[0])
pt=[list(pt_tmp.iloc[i]) for i in range(num_job)]
return pt
and in run.py
import pandas as pd
import numpy as np
import time
from src.fjsls.io.ExcelReadFile import ExcelReadFile
num_job=10
fileName = "JSP_dataset.xlsx"
pt = ExcelReadFile.processingTime(fileName, num_job)
it shows
`TypeError: processingTime() missing 1 required positional argument: 'num_job'
when i call processingTime()
Could you please help to check and a little explanation about script creation in Python?