My sample data was as follows
Tag_Typ | Alpha_Estimate | Beta_Estimate | PM01_Avg_Cost | PM02_Avg_Cost |
---|---|---|---|---|
OLK-AC-101-14A_PM01 | 497.665 | 0.946584 | 1105.635 | 462.3833775 |
OLK-AC-103-01_PM01 | 288.672 | 0.882831 | 1303.8875 | 478.744375 |
OLK-AC-1105-01_PM01 | 164.282 | 0.787158 | 763.4475758 | 512.185814 |
OLK-AC-236-05A_PM01 | 567.279 | 0.756839 | 640.718 | 450.3277778 |
OLK-AC-276-05A_PM01 | 467.53 | 0.894773 | 1536.78625 | 439.78 |
This my sample code
import pandas as pd
import numpy as np
from reliability.Repairable_systems import optimal_replacement_time
import matplotlib.pyplot as plt
data = pd.read_excel (r'C:\Users\\EU_1_EQ_PM01_Cost.xlsx')
data_frame = pd.DataFrame(data, columns= ['Alpha_Estimate','Beta_Estimate','PM01_Avg_Cost','PM02_Avg_Cost'])
Alpha_Est=pd.DataFrame(data, columns= ['Alpha_Estimate'])
Beta_Est=pd.DataFrame(data, columns= ['Beta_Estimate'])
PM_Est=pd.DataFrame(data, columns= ['PM02_Avg_Cost'])
CM_Est=pd.DataFrame(data, columns= ['PM01_Avg_Cost'])
optimal_replacement_time(cost_PM=PM_Est, cost_CM=CM_Est, weibull_alpha=Alpha_Est, weibull_beta=Beta_Est,q=0)
plt.show()
I need to loop through the value set for each tag and pass those values to the Optimal replacement function to return the results.
[Sample Output] ValueError: Can only compare identically-labeled DataFrame objects
I would appreciate any suggestions on how I can pass the values of the PM cost, PPM cost, and the distribution parameters alpha and beta in the function as I iterate through the tag-type and print the results for each tag. Thanks.