https://raw.githubusercontent.com/MatthewReid854/reliability/master/docs/images/logo.png

FR_to_XCN

class reliability.Convert_data.FR_to_XCN(failures, right_censored=None, censor_code='C', failure_code='F')

FR_to_XCN data format converter

Inputs: failures - array or list right_censored - array or list. Optional input. censor_code - the int or str to use for the censored items. Default is ‘C’ failure_code - the int or str to use for the failed items. Default is ‘F’

Output: X - event time C - censor code N - number of events at each event time

Methods: print() - this will print a dataframe of the data in XCN format to the console write_to_xlsx() - this will export the data in XCN format to an xlsx file at the specified path.

Example usage: XCN = FR_to_XCN(failures=[1,1,2,2,3], right_censored=[9,9,9,9,8,8,7]) print(XCN.X)

>>> [1 2 3 7 8 9]
print(XCN.C)
>>> ['F' 'F' 'F' 'C' 'C' 'C']
print(XCN.N)
>>> [2 2 1 1 2 4]
XCN.print()
>>> Data (XCN format)
    event time censor code  number of events
             1           F                 2
             2           F                 2
             3           F                 1
             7           C                 1
             8           C                 2
             9           C                 4
print()
write_to_xlsx(path, **kwargs)