Skip to content

Commit

Permalink
Update Other_functions.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewReid854 committed Jul 23, 2019
1 parent e82d0b8 commit 751ec4d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions reliability/Other_functions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'''
Other Functions and Tests
Other Functions
This is a collection of many tools that did not otherwise fit within their own module.
Included functions are:
Expand All @@ -11,6 +11,8 @@
are also plotted on the chart.
reliability_growth - uses the Duane method to find the instantaneous MTBF and produce a reliability growth plot.
optimal_replacement_time - Calculates the cost model to determine how cost varies with replacement time. The cost model assumes Power Law NHPP
convert_labels_to_binary - Converts values in a list or array to binary values to represent failures and censored data
convert_dataframe_to_grouped_lists - groups values in a 2-column dataframe based on the values in the left column and returns those groups in a list of lists
'''
def one_sample_proportion(trials=None,successes=None,CI=0.95):
'''
Expand Down Expand Up @@ -309,6 +311,8 @@ def convert_labels_to_binary(input_list=None,values_to_make_1=None):
print(outcome_new) >>> [0, 0, 0, 1]
'''
import numpy as np

if values_to_make_1 is None:
raise ValueError('you must specify values_to_make_1. This can be either a single item or a list of items.')
if input_list is None:
Expand Down Expand Up @@ -344,7 +348,7 @@ def convert_dataframe_to_grouped_lists(input_dataframe):
print(names[1]) >>> Failed
print(lists[1]) >>> [1253, 1342, 1489]
'''

import pandas as pd
df = input_dataframe
column_names = df.columns.values
if len(column_names)>2:
Expand Down

0 comments on commit 751ec4d

Please sign in to comment.