<jupyter_start><jupyter_text>- attempt to cast to out_type- if cast to str, just do    na type for str ?- if cast to numeric :    - pd.to_numeric with coerce to detect potential issue and store them    - cast to out_type<jupyter_code>new_data.MatCode == data.MatCode.astype(int)
new_data<jupyter_output><empty_output><jupyter_text>Import ?<jupyter_code>import os, glob
from os import walk
from os.path import dirname, join, isfile, basename, isdir, exists, normpath
basefolder = dirname('./nodes/__init__.py')
modules = []
for path in glob.glob(join(basefolder, '*')):
    if isfile(path) and not path.endswith('__init__.py'):
        modules.append(basename(path)[:-3])
    elif isdir(path) and exists(join(path, '__init__.py')):
        modules.append(normpath(basename(path)))
modules
import xml.etree.ElementTree as ET
import re
import pandas as pd
pd.read_csv('./Stats/Prop_dyn_generation/Models/Latent_description.csv', index_col=[0]).loc['80%']*pd.DataFrame([[0.5]*6])
def parse_gpx(file):
    tree = ET.parse(file)
    root = tree.getroot()
    try:
        ns = re.match('\{.*\}', root.tag).group(0)
    except:
        ns = ''

    coords = {'lat': [], 'lon': [], 'ele': [], 'time': []}
    # Itère sur chaque point du trajet
    for element in tree.iter(ns+'trkpt'):
        coords['lat'].append(element.attrib['lat'])
        coords['lon'].append(element.attrib['lon'])
        child = element.getchildren()
        for value in child:
            if value.tag == ns+'ele': coords['ele'].append(value.text)
            if value.tag == ns+'time': coords['time'].append(value.text)
                
    return pd.DataFrame(coords).apply(pd.to_numeric, errors='ignore')
file = 'F:/Downloads/Randonnée/iti0584_crete_du_sancy.gpx'
coords = parse_gpx(file)
from plotly.offline import download_plotlyjs, init_notebook_mode, plot, iplot
from plotly.graph_objs import *
init_notebook_mode(connected=True)
plotly_config = {'showLink': False, 'displaylogo': False, 'modeBarButtonsToRemove': ['sendDataToCloud']}
data = [dict(
            type = 'scattergeo',
            locationmode = 'USA-states',
            lon = coords['lon'],
            lat = coords['lat'],
            mode = 'lines',
            line = dict(
                width = 1,
                color = 'red',
            )
        )]
layout = dict(
        title = file,
        showlegend = False, 
        geo = dict(
            scope='europe',
            projection=dict( type='azimuthal equal area' ),
            showland = True,
            landcolor = 'rgb(243, 243, 243)',
            countrycolor = 'rgb(204, 204, 204)',
        ),
    )
    
fig = dict( data=data, layout=layout )
iplot(fig, filename='d3-flight-paths', config=plotly_config)
import pilllow<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14600650524033248, 'fraction_numerical': 0.011564871702204554, 'mean_word_length': 2.9656160458452723, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 1}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '81906', 'license': 'MIT', 'n_tokens_mistral': 929, 'n_tokens_neox': 895, 'n_words': 202, 'path': 'examples/example_data/.ipynb_checkpoints/Dev-checkpoint.ipynb', 'repo_name': 'lcopey/node_editor', 'size': '2767'}