<jupyter_start><jupyter_text>Downloading of Helsinki XYZ dataTakes the “Exact elevation model xyz triangle grid” data layer from https://kartta.hel.fi/ with Python script, a total of 52,5 million points, and converts it to a .csv.<jupyter_code># Sets the tile boundries (inclusive)
xmin = 490
xmax = 514

ymin = 668
ymax = 686

# Creates a list of filenames to download
filenames = []
for x in range(xmin,xmax+1):
    for y in range(ymin,ymax+1):
        filenames.append(f'Mm_{y}{x}.xyz')
import requests
import io

# Downloads all the XYZ files
base_url = 'https://kartta.hel.fi/helshares/Tarkkamalli/'
for file in filenames:
    url = base_url+file
    print(url)
    r = requests.get(url)
    if r.status_code == 404:
        continue
    with open('everything.txt', 'ab') as f:
        f.write(r.content)
import pandas as pd

# Converts the text file to a Pandas database
df1 = pd.read_csv('everything.txt', sep=' ', header=None)
print(df1)

# Removes the first column and writes to a CSV file
df1 = df1.drop(0, 1)
df1.to_csv('everything.csv', index=False, header=False)<jupyter_output>0             1            2      3    4
0         1  2.549050e+07  6670003.208  0.049    2
1         1  2.549049e+07  6670000.730  0.078    6
2         1  2.549049e+07  6670009.143  0.028    6
3         1  2.549049e+07  6670006.272  0.108   14
4         1  2.549049e+07  6670003.133  0.038    4
...      ..           ...          ...    ...  ...
52515359  1  2.551500e+07  6686999.772  7.991  103
52515360  1  2.551500e+07  6686999.607  8.031  167
52515361  1  2.551500e+07  6686998.231  8.011   33
52515362  1  2.551500e+07  6686998.747  8.031   36
52515363  1  2.551500e+07  6686999.509  8.031   32

[52515364 rows x 5 columns]
                     1            2      3    4
0         2.549050e+07  6670003.208  0.049    2
1         2.549049e+07  6670000.730  0.078    6
2         2.549049e+07  6670009.143  0.028    6
3         2.549049e+07  6670006.272  0.108   14
4         2.549049e+07  6670003.133  0.038    4
...                ...          ...    ...  ...
52515359  2.551500e+07 [...]
{'fraction_non_alphanumeric': 0.10690316395014382, 'fraction_numerical': 0.23537871524448706, 'mean_word_length': 1.968705547652916, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '184687', 'license': 'MIT', 'n_tokens_mistral': 1092, 'n_tokens_neox': 803, 'n_words': 224, 'path': 'data-processing/xyz_helsinki_complete.ipynb', 'repo_name': 'EwoutH/Helsinki-flood-BEP-project', 'size': '2086'}