<jupyter_start><jupyter_text>Not found             ('WAG The Economic Development Group within DEandT'), WAG DEandT WEFO<jupyter_code>wales_nonedu = pd.merge(wales, walesLocations, how='left', left_on='Lead Organisation', right_on='Lead Organisation')
wales_nonedu.shape
postcodes = pd.read_csv('data/postcodes/input/ukpostcodes.csv')
postcodes.head()
postcodes['postcode'] = postcodes.postcode.str.strip().str.replace(' ', '')
wales_nonedu =  pd.merge(wales_nonedu, postcodes,  left_on=['postcode1'], right_on=['postcode'])
wales_nonedu.columns
wales_edu.columns
wales.columns
wales_edu = wales_edu.rename(index=str, columns={"Project Title": "project", "Lead Organisation": "beneficiary", "EU funds awarded": "eu_investment", "Total Project cost": "project_cost"})
wales_nonedu = wales_nonedu.rename(index=str, columns={"Project Title": "project", "Lead Organisation": "beneficiary", "EU funds awarded": "eu_investment", "Total Project cost": "project_cost"})
def make_wales_data_geo_json(coordis_data):
    def make_feature(row):
        properties = {
            property: row[property]
            for property in ['project','beneficiary', 'Project Description',  'eu_investment', 'project_cost']
            if str(row[property]) != 'nan'
        }
        properties['Project start date'] = str(row['Project start date'])
        properties['Project end date'] = str(row['Project end date'])
        return {
            'type': 'Feature',
            'geometry': {
                "type": "Point",
                "coordinates": [row['longitude'], row['latitude']]
            },
            'properties': properties
        }
    features = list(coordis_data.apply(make_feature, axis=1))
    return { 'type': 'FeatureCollection', 'features': features }
with open('data/wales_erdf_esf/output/wales_data.geo.json', 'w') as file:
    json.dump(make_wales_data_geo_json(
        wales_nonedu[~pd.isnull(wales_nonedu['latitude'])]
    ), file, sort_keys=True)
def make_wales_edu_data_geo_json(coordis_data):
    def make_feature(row):
        properties = {
            property: row[property]
            for property in ['project','beneficiary', 'Project Description',  'eu_investment', 'project_cost']
            if str(row[property]) != 'nan'
        }
        properties['Project start date'] = str(row['Project start date'])
        properties['Project end date'] = str(row['Project end date'])
        return {
            'type': 'Feature',
            'geometry': {
                "type": "Point",
                "coordinates": [row['lng'], row['lat']]
            },
            'properties': properties
        }
    features = list(coordis_data.apply(make_feature, axis=1))
    return { 'type': 'FeatureCollection', 'features': features }
with open('data/wales_erdf_esf/output/wales_edu_data.geo.json', 'w') as file:
    json.dump(make_wales_edu_data_geo_json(
        wales_edu[~pd.isnull(wales_edu['lat'])]
    ), file, sort_keys=True)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14697020421827922, 'fraction_numerical': 0.001004352192835621, 'mean_word_length': 3.5828220858895707, 'pattern_counts': {'":': 12, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '597055', 'license': 'Apache-2.0', 'n_tokens_mistral': 940, 'n_tokens_neox': 916, 'n_words': 181, 'path': 'prototype/wales-approved-projects-2015.ipynb', 'repo_name': 'meloncholy/my_eu', 'size': '2987'}