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

FNRN_to_XCN

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

FNRN_to_XCN data format converter

Inputs: failures - array or list num_failures - array or list. Length must match length of failures right_censored - array or list. Optional input. num_right_censored - array or list. Optional Input. Length must match length of right_censored 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 = FNRN_to_XCN(failures=[1, 2, 3], num_failures=[2, 2, 1], right_censored=[9, 8, 7], num_right_censored=[3, 2, 1]) 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 3]
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                 3
print()
write_to_xlsx(path, **kwargs)