fpl/fpl.py
def calculate_fdr(average_points, extrema):
            """Returns a dict containing the FDR for each team, which is
            calculated by scaling the average points conceded per position
            between 1.0 and 5.0 using the given extrema.

            :param dict points_against: A dict containing the points scored
                against each team in the Premier League.
            :param dict extrema: A dict containing the extrema for each
                position and location.
            :rtype: dict
            """
            for team, positions in average_points.items():
                for position, locations in positions.items():
                    min_h, max_h = extrema[position]["H"]
                    min_a, max_a = extrema[position]["A"]

                    fdr_h = scale(locations["H"], 5.0, 1.0, min_h, max_h)
                    fdr_a = scale(locations["A"], 5.0, 1.0, min_a, max_a)

                    average_points[team][position]["H"] = fdr_h
                    average_points[team][position]["A"] = fdr_a

            return average_points
Returns a dict containing the FDR for each team, which is
            calculated by scaling the average points conceded per position
            between 1.0 and 5.0 using the given extrema.

            :param dict points_against: A dict containing the points scored
                against each team in the Premier League.
            :param dict extrema: A dict containing the extrema for each
                position and location.
            :rtype: dict
            
Returns a dict containing the FDR for each team, which is
calculated by scaling the average points conceded per position
between 1.0 and 5.0 using the given extrema.
Returns a dict containing the FDR for each team which is calculated by scaling the average points conceded per position between 1 . 0 and 5 . 0 using the given extrema .
def calculate_fdr(average_points, extrema):
            for team, positions in average_points.items():
                for position, locations in positions.items():
                    min_h, max_h = extrema[position]["H"]
                    min_a, max_a = extrema[position]["A"]
                    fdr_h = scale(locations["H"], 5.0, 1.0, min_h, max_h)
                    fdr_a = scale(locations["A"], 5.0, 1.0, min_a, max_a)
                    average_points[team][position]["H"] = fdr_h
                    average_points[team][position]["A"] = fdr_a
            return average_points
def calculate_fdr ( average_points , extrema ) : for team , positions in average_points . items ( ) : for position , locations in positions . items ( ) : min_h , max_h = extrema [ position ] [ "H" ] min_a , max_a = extrema [ position ] [ "A" ] fdr_h = scale ( locations [ "H" ] , 5.0 , 1.0 , min_h , max_h ) fdr_a = scale ( locations [ "A" ] , 5.0 , 1.0 , min_a , max_a ) average_points [ team ] [ position ] [ "H" ] = fdr_h average_points [ team ] [ position ] [ "A" ] = fdr_a return average_points
Returns a dict containing the FDR for each team, which is
calculated by scaling the average points conceded per position
between 1.0 and 5.0 using the given extrema.
Returns a dict containing the FDR for each team which is calculated by scaling the average points conceded per position between 1 . 0 and 5 . 0 using the given extrema .
"""Returns a dict containing the FDR for each team, which is
            calculated by scaling the average points conceded per position
            between 1.0 and 5.0 using the given extrema.

            :param dict points_against: A dict containing the points scored
                against each team in the Premier League.
            :param dict extrema: A dict containing the extrema for each
                position and location.
            :rtype: dict
            """
None
dict
average_points
extrema
A dict containing the extrema for each
position and location.
A dict containing the extrema for each position and location .
points_against
A dict containing the points scored
against each team in the Premier League.
A dict containing the points scored against each team in the Premier League .