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

FNRN_to_FR

class reliability.Convert_data.FNRN_to_FR(failures, num_failures, right_censored=None, num_right_censored=None)

Converts data from FNRN format to FR format

Parameters:
  • failures (array, list) – The failure times

  • num_failures (array, list) – The number of failures are each failure time. Length must match length of failures.

  • right_censored (array, list, optional) – The right censored times

  • num_right_censored (array, list, optional) – The number of values at each right_censored time. Length must match length of right_censored.

Returns:

  • failures (array) – The failure times

  • right_censored (array) – The right censored times

Notes

Example usage:

FR = FNRN_to_FR(failures=[1,2,3], num_failures=[1,1,2], right_censored=[9,8,7], num_right_censored=[5,4,4])
print(FR.failures)
    >>> [1. 2. 3. 3.]
print(FR.right_censored)
   >>> [9. 9. 9. 9. 9. 8. 8. 8. 8. 7. 7. 7. 7.]
FR.print()
   >>>  Data (FR format)
        failures  right censored
               1               9
               2               9
               3               9
               3               9
                               9
                               8
                               8
                               8
                               8
                               7
                               7
                               7
                               7
print()

This will print a dataframe of the data in FR format to the console

write_to_xlsx(path, **kwargs)

This will export the data in FR format to an xlsx file at the specified path.

Parameters:
  • path (str) – The file path of the xlsx file to be written

  • kwargs – Keyword arguments passed directly to pandas