def get_values_from_csv(csv_reader, observations_col=1, frequency_col=2):
    """Gets values from csv file.

    Args:
        csv_reader:
        observations_col (int, default 1): Column number of observations.
        frequency_col (int, default 2): Column number of frequency.
          if < 0 or csv file has only one column, values will only
          be considered.

    Returns:
        A list of observation-frequency tuples like::

            [(23.3, 1), (80.1, 3), (99.3, 2)]
    """
    result = []
    for row in csv_reader:
        try:
            observation = float(row[observations_col - 1])
            frequency = 1
        except (ValueError, IndexError):
            continue
        if len(row) > 1:
            try:
                if frequency_col < 0:
                    frequency = 1
                else:
                    frequency = int(row[frequency_col - 1])
            except (ValueError, IndexError):
                raise ValueError
        else:
            frequency = 1
        result.append((observation, frequency))
    return result
