def naRow(df, threshold=0.5, print_result=True):
    """
    Checks for null or missing values in all rows of a Pandas dataframe

    Arguments:
    df: A Pandas dataframe
    threshold: The percentage of missing values out of all dataframe
            columns that are allowed to be null
    print_result: indicates whether or not the output should be printed to the console

    Returns:
    dict: (key:value) = (row_index:number_missing_values)    
    """
    y = dict.fromkeys(df.index)
    for idx, key in enumerate(y.keys()):
        y[key] = sum(df.iloc[[idx]].isnull().sum())
    if print_result:
        print("Rows with more than 50% null columns:")
        print([r for r in y if y[r]/df.shape[1] > threshold])
    return y