<jupyter_start><jupyter_text>Number of occupied ponds<jupyter_code>std_data = data.groupby(['mortality-decrease-with-buffer', 'distance-for-viewing-ponds-and-woodland']).std()

std_values_buffer = std_data['occupied-ponds-buffer'].values
std_values_corridors = std_data['occupied-ponds-corridor'].values
std_values_diff = std_data['ponds_diff'].values

heat_data_diff_std = pd.DataFrame(np.reshape(std_values_diff, (5, 7)), 
                         index = np.unique(data['mortality-decrease-with-buffer']), 
                         columns = np.unique(data['distance-for-viewing-ponds-and-woodland']) )



means_data = data.groupby(['mortality-decrease-with-buffer', 'distance-for-viewing-ponds-and-woodland']).mean()

mean_values_buffer = means_data['occupied-ponds-buffer'].values
mean_values_corridors = means_data['occupied-ponds-corridor'].values
mean_values_diff = means_data['ponds_diff'].values

heat_data_buffer = pd.DataFrame(np.reshape(mean_values_buffer, (5, 7)), 
                         index = np.unique(data['mortality-decrease-with-buffer']), 
                         columns = np.unique(data['distance-for-viewing-ponds-and-woodland']) )

heat_data_corridors = pd.DataFrame(np.reshape(mean_values_corridors, (5, 7)), 
                         index = np.unique(data['mortality-decrease-with-buffer']), 
                         columns = np.unique(data['distance-for-viewing-ponds-and-woodland']) )

heat_data_diff = pd.DataFrame(np.reshape(mean_values_diff, (5, 7)), 
                         index = np.unique(data['mortality-decrease-with-buffer']), 
                         columns = np.unique(data['distance-for-viewing-ponds-and-woodland']) )
plt.figure(figsize= (15,8))
sns.heatmap(heat_data_buffer, annot=False, square = False)
plt.ylabel('Mortality decrease with buffers', size=15)
plt.xlabel('How far can newts see ponds and woodland?', size=15)
plt.title('Buffers', size=20)
plt.show();

plt.figure(figsize= (15,8))
sns.heatmap(heat_data_corridors, annot=False, square = False)
plt.ylabel('Mortality decrease with buffers', size=15)
plt.xlabel('How far can newts see ponds and woodland?', size=15)
plt.title('Corridors', size=20)
plt.show();
heat_data_diff_std / np.sqrt(60)
fig, ax =plt.subplots(1,2, figsize=(15,8), sharey=True)
sns.set(font_scale=1.5)

sns.heatmap(heat_data_diff, 
            annot=False, square = False, 
            center = 0, 
            cmap="RdYlGn", 
            ax=ax[0])
ax[0].tick_params(axis='both', which='major', labelsize=14, labelcolor='grey')
ax[0].set_ylabel('Mortality decrease in buffer scenario', size=18)
ax[0].set_xlabel('Viewing distance', size=18)
ax[0].set_title('Buffer - Corridor', size=20)


sns.heatmap(heat_data_diff_std / np.sqrt(60), 
            annot=False, square = False, 
            center = 0.15, 
            cmap=plt.get_cmap('Greys'),
            ax=ax[1])

ax[1].tick_params(axis='both', which='major', labelsize=14, labelcolor='grey')
ax[1].set_xlabel('Viewing distance', size=18)
ax[1].set_title('Standard error of the mean', size=20);
  
plt.tight_layout()

          
plt.savefig('../results/mortality_viewing_distance_heatmap_ponds.svg')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1532156368221942, 'fraction_numerical': 0.0201765447667087, 'mean_word_length': 3.896604938271605, 'pattern_counts': {'":': 0, '<': 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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '659242', 'license': 'MIT', 'n_tokens_mistral': 1196, 'n_tokens_neox': 1086, 'n_words': 155, 'path': 'model analysis/1 Standard experiment/scripts/standard_experiment.ipynb', 'repo_name': 'FelixNoessler/Buffers-or-corridors-for-great-crested-newts', 'size': '3172'}