Skip to content

Examples

Title

Create example lgbf metadata.

Returns

Pandas data.frame with metadata for two indicators.
Source code in src/lgbfscotland/utils_example_data.py
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
def example_lgbf_metadata() -> pd.DataFrame:
    """
    Title
    -----
    Create example lgbf metadata.

    Returns
    -------
        Pandas data.frame with metadata for two indicators.
    """
    return pd.DataFrame(
        {
            "Indicators_Information_Code": ["C&L02", "SW01"],
            "Indicators_Information_Title": [
                "Cost per Library Visit",
                "Home care costs per hour for people aged 65 or over",
            ],
            "Indicators_Information_ServiceArea": [
                "Culture & Leisure Services",
                "Adult Social Care Services",
            ],
            "Indicators_Information_Numerator_Title": [
                "Libraries - net expenditure (£000)",
                "Total Homecare Expenditure  (£000)",
            ],
            "Indicators_Information_Denominator_Title": [
                "Number of Library Visits",
                "Care Hours per Year,",
            ],
            "Indicators_Information_Unit": "Pounds",
            "Indicators_Information_Category": "Financial",
        }
    )

Title

Create example lgbf data.

Returns

Pandas data.frame with metric data for two indicators.
Source code in src/lgbfscotland/utils_example_data.py
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
def example_lgbf_data() -> pd.DataFrame:
    """
    Title
    -----
    Create example lgbf data.

    Returns
    -------
        Pandas data.frame with metric data for two indicators.
    """
    return pd.DataFrame(
        {
            "Indicators_Information_Code": [
                "C&L02",
                "C&L02",
                "C&L02",
                "C&L02",
                "SW01",
                "SW01",
                "SW01",
                "SW01",
            ],
            "LA_Information_LocalAuthority": [
                "Aberdeen City",
                "Aberdeen City",
                "Falkirk",
                "Falkirk",
                "Aberdeen City",
                "Aberdeen City",
                "Falkirk",
                "Falkirk",
            ],
            "LA_Data_LGBF_Year": [
                "2010-11",
                "2011-12",
                "2010-11",
                "2011-12",
                "2010-11",
                "2011-12",
                "2010-11",
                "2011-12",
            ],
            "LA_Data_LA_IndicatorReal": [
                5.211,
                3.5006,
                5.3123,
                6.1508,
                29.1235,
                28.0328,
                30.7446,
                33.6309,
            ],
            "LA_Data_LA_Numerator_real": [
                8243.444,
                5491.772,
                4572.615,
                4509.631,
                19564.248,
                19702.353,
                21858.517,
                21622.702,
            ],
            "LA_Data_LA_Den_Real": [
                1582483,
                1570220,
                860025,
                733914,
                671922.2,
                702913.1,
                711079.7,
                642815.7,
            ],
            "Scotland_Data_Scotland_Indicator_Real": [
                4.9359,
                4.6202,
                4.9359,
                4.6202,
                29.1524,
                28.0187,
                29.1524,
                28.0187,
            ],
            "Scotland_Data_Scotland_Num_Real": [
                156854.1,
                148097.9,
                156854.1,
                148097.9,
                629716.6,
                616961.4,
                629716.6,
                616961.4,
            ],
            "Scotland_Data_Scotland_Den_Real": [
                31800305,
                32074635,
                31800305,
                32074635,
                21602216,
                22016337,
                21602216,
                22016337,
            ],
            "FG_Data_FG_Avg_Indicator_Real": [
                5.523975,
                5.041812,
                5.523975,
                5.041812,
                30.60895,
                32.047125,
                27.290575,
                26.096563,
            ],
            "FG_Data_FG_Avg_Num_Real": [
                8956.513,
                8341.825,
                8956.513,
                8341.825,
                15864.469,
                16624.835,
                21924.016,
                21610.404,
            ],
            "FG_Data_FG_Avg_Den_Real": [
                1804141.5,
                1805378.4,
                1804141.5,
                1805378.4,
                548521.2,
                550521.9,
                817185.5,
                823029.2,
            ],
        }
    )