{ "cells": [ { "cell_type": "markdown", "id": "dee9ac98", "metadata": { "scrolled": true }, "source": [ "# Converting postcode to area\n" ] }, { "cell_type": "code", "execution_count": 1, "id": "d4426ad1", "metadata": { "tags": [ "remove-cell" ] }, "outputs": [], "source": [ "import sys\n", "MAIN_PATH = \"C:\\\\Users\\\\44781\\\\Documents\\\\GitHub\\\\Pesticide\"\n", "sys.path.append(MAIN_PATH)" ] }, { "cell_type": "markdown", "id": "e3095b2f", "metadata": {}, "source": [ "## Imports" ] }, { "cell_type": "code", "execution_count": 2, "id": "4a74c8fe", "metadata": { "tags": [ "hide-cell" ] }, "outputs": [ { "data": { "text/html": [ "
\n", " | sample_id | \n", "date_of_sampling | \n", "description | \n", "country_of_origin | \n", "retail_outlet | \n", "address | \n", "brand_name | \n", "packer_/_manufacturer_/_importer | \n", "pesticide_residues_found_in_mg/kg_(mrl) | \n", "product | \n", "address_postcode | \n", "packer__postcode | \n", "chem_name | \n", "amount_detected | \n", "mrl | \n", "amount_pc | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "1958/2016 | \n", "2016-08-08 | \n", "Bramley Apples | \n", "UK | \n", "Asda | \n", "Creechbarrow Road, Taunton TA1 2AN | \n", "Asda | \n", "Asda Stores Ltd Leeds, UK LS11 5AD | \n", "boscalid 0.03 (MRL = 2) | \n", "Apple | \n", "TA1 2AN | \n", "LS11 5AD | \n", "boscalid | \n", "0.03 | \n", "2.0 | \n", "0.015000 | \n", "
1 | \n", "1958/2016 | \n", "2016-08-08 | \n", "Bramley Apples | \n", "UK | \n", "Asda | \n", "Creechbarrow Road, Taunton TA1 2AN | \n", "Asda | \n", "Asda Stores Ltd Leeds, UK LS11 5AD | \n", "pyraclostrobin 0.01 (MRL = 0.5) | \n", "Apple | \n", "TA1 2AN | \n", "LS11 5AD | \n", "pyraclostrobin | \n", "0.01 | \n", "0.5 | \n", "0.020000 | \n", "
2 | \n", "0230/2016 | \n", "2016-08-08 | \n", "Bramley Apples | \n", "UK | \n", "Co-op | \n", "Northgate, Louth LN11 0LT | \n", "Co-op | \n", "Co-operative Group Ltd Manchester M60 0AG | \n", "boscalid 0.05 (MRL = 2) | \n", "Apple | \n", "LN11 0LT | \n", "M60 0AG | \n", "boscalid | \n", "0.05 | \n", "2.0 | \n", "0.025000 | \n", "
3 | \n", "0230/2016 | \n", "2016-08-08 | \n", "Bramley Apples | \n", "UK | \n", "Co-op | \n", "Northgate, Louth LN11 0LT | \n", "Co-op | \n", "Co-operative Group Ltd Manchester M60 0AG | \n", "flonicamid (sum) 0.02 (MRL = 0.2) | \n", "Apple | \n", "LN11 0LT | \n", "M60 0AG | \n", "flonicamid (sum) | \n", "0.02 | \n", "0.2 | \n", "0.100000 | \n", "
4 | \n", "0230/2016 | \n", "2016-08-08 | \n", "Bramley Apples | \n", "UK | \n", "Co-op | \n", "Northgate, Louth LN11 0LT | \n", "Co-op | \n", "Co-operative Group Ltd Manchester M60 0AG | \n", "pyraclostrobin 0.03 (MRL = 0.5) | \n", "Apple | \n", "LN11 0LT | \n", "M60 0AG | \n", "pyraclostrobin | \n", "0.03 | \n", "0.5 | \n", "0.060000 | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
23947 | \n", "0792/2022 | \n", "2022-09-08 | \n", "Marfona Unwashed Potatoes | \n", "UK | \n", "Stoke Fruit Farm | \n", "77 Havant Road, Hayling Island, Hampshire PO11... | \n", "None stated | \n", "Stoke Fruit Farm 77 Havant Road, Hayling Islan... | \n", "maleic hydrazide 7.7 (MRL = 60) | \n", "Potatoes_(GB) | \n", "PO11 0PT | \n", "PO11 0PT | \n", "maleic hydrazide | \n", "7.70 | \n", "60.0 | \n", "0.128333 | \n", "
23948 | \n", "0765/2022 | \n", "2022-09-14 | \n", "Sagitta Potatoes | \n", "UK | \n", "Total Produce Ltd. | \n", "Callywith Gate Industrial Estate, Launceston R... | \n", "None stated | \n", "CS Duston & Son Colwith Farm, Par, Cornwall | \n", "maleic hydrazide 17 (MRL = 60) | \n", "Potatoes_(GB) | \n", "PL31 2RQ | \n", "0 | \n", "maleic hydrazide | \n", "17.00 | \n", "60.0 | \n", "0.283333 | \n", "
23949 | \n", "0938/2022 | \n", "2022-09-01 | \n", "Marfona Ware Potatoes | \n", "UK | \n", "Tulipland Potatoes Ltd | \n", "Fengate, Moulton Chapel PE12 0XL | \n", "None stated | \n", "Garden of Elveden | \n", "NaN | \n", "Potatoes_(GB) | \n", "PE12 0XL | \n", "0 | \n", "0 | \n", "0.00 | \n", "0.0 | \n", "0.000000 | \n", "
23950 | \n", "0833/2022 | \n", "2022-08-31 | \n", "Lady Rosetta | \n", "England (UK) | \n", "Tyrrells Crisps | \n", "Tyrrells Court, Stretford Bridge, Leominster H... | \n", "None stated | \n", "KP Crisps | \n", "NaN | \n", "Potatoes_(GB) | \n", "HR6 9DQ | \n", "0 | \n", "0 | \n", "0.00 | \n", "0.0 | \n", "0.000000 | \n", "
23951 | \n", "0833/2022 | \n", "2022-08-31 | \n", "Lady Rosetta | \n", "England (UK) | \n", "Tyrrells Crisps | \n", "Tyrrells Court, Stretford Bridge, Leominster H... | \n", "None stated | \n", "KP Crisps | \n", "NaN | \n", "Potatoes_(GB) | \n", "HR6 9DQ | \n", "0 | \n", "0 | \n", "0.00 | \n", "0.0 | \n", "0.000000 | \n", "
23952 rows × 16 columns
\n", "\n", " | Postcode | \n", "mapArea | \n", "
---|---|---|
0 | \n", "AL1 1AG | \n", "Hertfordshire | \n", "
1 | \n", "AL1 1AJ | \n", "Hertfordshire | \n", "
2 | \n", "AL1 1AR | \n", "Hertfordshire | \n", "
3 | \n", "AL1 1AS | \n", "Hertfordshire | \n", "
4 | \n", "AL1 1AT | \n", "Hertfordshire | \n", "
\n", " | sample_id | \n", "date_of_sampling | \n", "description | \n", "country_of_origin | \n", "retail_outlet | \n", "address | \n", "brand_name | \n", "packer_/_manufacturer_/_importer | \n", "pesticide_residues_found_in_mg/kg_(mrl) | \n", "product | \n", "address_postcode | \n", "packer__postcode | \n", "chem_name | \n", "amount_detected | \n", "mrl | \n", "amount_pc | \n", "area_to_plot | \n", "
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | \n", "1958/2016 | \n", "2016-08-08 | \n", "Bramley Apples | \n", "UK | \n", "Asda | \n", "Creechbarrow Road, Taunton TA1 2AN | \n", "Asda | \n", "Asda Stores Ltd Leeds, UK LS11 5AD | \n", "boscalid 0.03 (MRL = 2) | \n", "Apple | \n", "TA1 2AN | \n", "LS11 5AD | \n", "boscalid | \n", "0.03 | \n", "2.0 | \n", "0.015000 | \n", "Somerset | \n", "
1 | \n", "1958/2016 | \n", "2016-08-08 | \n", "Bramley Apples | \n", "UK | \n", "Asda | \n", "Creechbarrow Road, Taunton TA1 2AN | \n", "Asda | \n", "Asda Stores Ltd Leeds, UK LS11 5AD | \n", "pyraclostrobin 0.01 (MRL = 0.5) | \n", "Apple | \n", "TA1 2AN | \n", "LS11 5AD | \n", "pyraclostrobin | \n", "0.01 | \n", "0.5 | \n", "0.020000 | \n", "Somerset | \n", "
2 | \n", "0230/2016 | \n", "2016-08-08 | \n", "Bramley Apples | \n", "UK | \n", "Co-op | \n", "Northgate, Louth LN11 0LT | \n", "Co-op | \n", "Co-operative Group Ltd Manchester M60 0AG | \n", "boscalid 0.05 (MRL = 2) | \n", "Apple | \n", "LN11 0LT | \n", "M60 0AG | \n", "boscalid | \n", "0.05 | \n", "2.0 | \n", "0.025000 | \n", "Lincolnshire | \n", "
3 | \n", "0230/2016 | \n", "2016-08-08 | \n", "Bramley Apples | \n", "UK | \n", "Co-op | \n", "Northgate, Louth LN11 0LT | \n", "Co-op | \n", "Co-operative Group Ltd Manchester M60 0AG | \n", "flonicamid (sum) 0.02 (MRL = 0.2) | \n", "Apple | \n", "LN11 0LT | \n", "M60 0AG | \n", "flonicamid (sum) | \n", "0.02 | \n", "0.2 | \n", "0.100000 | \n", "Lincolnshire | \n", "
4 | \n", "0230/2016 | \n", "2016-08-08 | \n", "Bramley Apples | \n", "UK | \n", "Co-op | \n", "Northgate, Louth LN11 0LT | \n", "Co-op | \n", "Co-operative Group Ltd Manchester M60 0AG | \n", "pyraclostrobin 0.03 (MRL = 0.5) | \n", "Apple | \n", "LN11 0LT | \n", "M60 0AG | \n", "pyraclostrobin | \n", "0.03 | \n", "0.5 | \n", "0.060000 | \n", "Lincolnshire | \n", "
... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "... | \n", "
23947 | \n", "0792/2022 | \n", "2022-09-08 | \n", "Marfona Unwashed Potatoes | \n", "UK | \n", "Stoke Fruit Farm | \n", "77 Havant Road, Hayling Island, Hampshire PO11... | \n", "None stated | \n", "Stoke Fruit Farm 77 Havant Road, Hayling Islan... | \n", "maleic hydrazide 7.7 (MRL = 60) | \n", "Potatoes_(GB) | \n", "PO11 0PT | \n", "PO11 0PT | \n", "maleic hydrazide | \n", "7.70 | \n", "60.0 | \n", "0.128333 | \n", "Hampshire | \n", "
23948 | \n", "0765/2022 | \n", "2022-09-14 | \n", "Sagitta Potatoes | \n", "UK | \n", "Total Produce Ltd. | \n", "Callywith Gate Industrial Estate, Launceston R... | \n", "None stated | \n", "CS Duston & Son Colwith Farm, Par, Cornwall | \n", "maleic hydrazide 17 (MRL = 60) | \n", "Potatoes_(GB) | \n", "PL31 2RQ | \n", "0 | \n", "maleic hydrazide | \n", "17.00 | \n", "60.0 | \n", "0.283333 | \n", "Cornwall | \n", "
23949 | \n", "0938/2022 | \n", "2022-09-01 | \n", "Marfona Ware Potatoes | \n", "UK | \n", "Tulipland Potatoes Ltd | \n", "Fengate, Moulton Chapel PE12 0XL | \n", "None stated | \n", "Garden of Elveden | \n", "NaN | \n", "Potatoes_(GB) | \n", "PE12 0XL | \n", "0 | \n", "0 | \n", "0.00 | \n", "0.0 | \n", "0.000000 | \n", "Lincolnshire | \n", "
23950 | \n", "0833/2022 | \n", "2022-08-31 | \n", "Lady Rosetta | \n", "England (UK) | \n", "Tyrrells Crisps | \n", "Tyrrells Court, Stretford Bridge, Leominster H... | \n", "None stated | \n", "KP Crisps | \n", "NaN | \n", "Potatoes_(GB) | \n", "HR6 9DQ | \n", "0 | \n", "0 | \n", "0.00 | \n", "0.0 | \n", "0.000000 | \n", "Herefordshire | \n", "
23951 | \n", "0833/2022 | \n", "2022-08-31 | \n", "Lady Rosetta | \n", "England (UK) | \n", "Tyrrells Crisps | \n", "Tyrrells Court, Stretford Bridge, Leominster H... | \n", "None stated | \n", "KP Crisps | \n", "NaN | \n", "Potatoes_(GB) | \n", "HR6 9DQ | \n", "0 | \n", "0 | \n", "0.00 | \n", "0.0 | \n", "0.000000 | \n", "Herefordshire | \n", "
23952 rows × 17 columns
\n", "\n", " | Postcode | \n", "mapArea | \n", "
---|---|---|
0 | \n", "AL1 1AG | \n", "Hertfordshire | \n", "
1 | \n", "AL1 1AJ | \n", "Hertfordshire | \n", "
2 | \n", "AL1 1AR | \n", "Hertfordshire | \n", "
3 | \n", "AL1 1AS | \n", "Hertfordshire | \n", "
4 | \n", "AL1 1AT | \n", "Hertfordshire | \n", "
5 | \n", "AL1 1AU | \n", "Hertfordshire | \n", "
6 | \n", "AL1 1AW | \n", "Hertfordshire | \n", "
\n", " | Postcode | \n", "mapArea | \n", "
---|---|---|
0 | \n", "AB2 | \n", "North East Scotland | \n", "
1 | \n", "AB4 | \n", "North East Scotland | \n", "
2 | \n", "NP4 | \n", "South East Wales | \n", "
3 | \n", "CR0 | \n", "Greater London | \n", "
4 | \n", "NP9 | \n", "South East Wales | \n", "