<jupyter_start><jupyter_text>Simple statistics1. Distribution of species per region (Län).<jupyter_code>lan = sns.factorplot('Län', data=df, kind='count', size=8, aspect=2)
lan.set_xticklabels(rotation=45)<jupyter_output><empty_output><jupyter_text>ContributorsTo find out who contributed to the species observation, you can analyse the "Observatör" column.<jupyter_code># Show the 10 contributors that contributed the most. (change value of .nlargest() to show more) 
df['Observatör'].value_counts(normalize=False, sort=True, ascending=False, bins=None, dropna=True).nlargest(10)<jupyter_output><empty_output><jupyter_text><NAME> har fem saker 1. hej<jupyter_code># A little plot of the contributors
citizenscientists = sns.factorplot('Observatör', data=df, kind='count', size=8, aspect=2)
citizenscientists.set_xticklabels(rotation=45)<jupyter_output><empty_output><jupyter_text>Geographic visualization1. Make a new column where the WGS84 columns are formatted properly.2. Make a simple map using the folium library.<jupyter_code># Create a new column for the X and Y values, to be converted to latlong below
df['latlong'] = list(zip(df.X, df.Y))
map_1 = folium.Map(location=[62.128, 18.6435], zoom_start=4,
                   tiles='Mapbox Bright')

for index, row in df.iterrows():
    # Transform X,Y to latlong by switching place and replacing comma with dot
    longitude = row['latlong'][1].replace(',', '.')
    latitude = row['latlong'][0].replace(',', '.')
    
    #print(row)
    vet = str(row['Vetenskapligt namn'])
    svnamn = str(row['Svenskt namn']).capitalize()
    observ = str(row['Observatör'])
    lokal = str(row['Lokal'])
    lan = str(row['Län'])
    koord = str(row['Koordinatnoggrannhet (m)'])
    datum = str(row['Startdatum'])
    datakalla = str(row['Datakälla'])
    
    label = str(vet + " - " + svnamn + " | " + observ + " | " + lokal + ", " 
                + lan + " | Koordinatnogrannhet (m): " + koord + " | " + 
                datum + " | " + datakalla + " | Latitud: " 
                + latitude + " | Longitud: " + longitude)
            
    folium.Marker([longitude, latitude], popup=label).add_to(map_1)
    # Add to change colors: icon = folium.Icon(color ='blue')

map_1.save('mardhund.html')
map_1<jupyter_output><empty_output><jupyter_text>Time series1. Create dataframe with DateTime as index.2. Plot some value on time series frame.<jupyter_code># Create dataframe with DateTime as index. For time series.
ts = df.set_index(pd.DatetimeIndex(df['Startdatum'])) # Create a dataframe with datetime as index
print(ts.index) # make sure the dtype='datetime64[ns]'
print("Oldest value: " + ts['Startdatum'].min())
print("Newest value: " + ts['Startdatum'].max())
# Plotting time series of the coordinate accuracy. Has no real meaning, just for code. 
ts['Koordinatnoggrannhet (m)'].plot()
ts<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14116416869989543, 'fraction_numerical': 0.013942140118508192, 'mean_word_length': 4.572815533980583, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '19367', 'license': 'MIT', 'n_tokens_mistral': 1001, 'n_tokens_neox': 964, 'n_words': 239, 'path': 'mardhund.ipynb', 'repo_name': 'christopherkullenberg/AnalysisportalNotebooks', 'size': '2879'}