1 hidden cell
Preferred Plants for Bees
To identify which plants are preferred by the bees in our data, we will simply count the number of bees for each species of plant, and also differentiate between early and late season as different flowers bloom at different times. For this reason, we will not consider bees that were collect from the air, i.e. not found on a specific flower, despite them representing the largest portion of our data.
A caveat for this simplistic approach is that we do not know the ratios of different plant species at any of the sample sites, which forces us to unrealistically assume that there is an even distribution of all plant species at any given site.
Native Bees
We see from the figure below that Leucanthemum vulgare (more commonly known as the Ox-Eye Daisy) is by far the most popular flower among native bees in the early season. This flower is common in numerous parts of the world and it is thus hard (given the current dataset) to determine if its popularity is due to an innate preference by the bees or if it simply comes down to its dominance in numbers. Of course, flowers that are popular among pollinators will naturally spread more, so the two factors are expected to have a high degree of correlation.
For late season, we see that Chichorium intybus and Chamaecrista fasciculata are the most popular ones with Helenium flexuosum and Daucus carota as close third and fourth. Notable is that Daucus corta is also present in the early season giving it a total count higher than the other three. However, the size of our data is most likely not sufficient to provide any accurate ranking between these four.
Non-Native Bees
The number of non-native bees in our data is very small; with only 35 data points, meaningful statistical analysis is difficult. This is especially true, since 33 out of those data points are collected from the air with the remaining two being one for Daucus carota and one for Trifolium incarnatum. At least this beats my puny mind as I am doing this on the last day before the deadline.
## Extract only native bees
data_red_no_air = data_red[data_red['plant_species'] != 'None']
native_bees = data_red_no_air[data_red_no_air['native_bee'] == 1]
## plot a bar graph over visited plants by native bees
# order for the bars
order = native_bees['plant_species'].value_counts().index
# and, you know, the rest of the plotting:
plot_native = native_bees.pivot_table(index=['plant_species'], columns='season', values='native_bee', aggfunc=np.sum, fill_value=0)
plot_native = plot_native.reindex(order)
plot_native = plot_native.plot(kind='bar', stacked=True)
plot_native.set_xticklabels(plot_native.get_xticklabels(), rotation=90)
plot_native.set_xlabel('Plant Species')
plot_native.set_ylabel('Count')
plot_native.set_title('Plants Visited by Native Bees')
plt.show()Distribution of Bee Species over Plant Species in a Single Sample
Below we see a heatmap for the plant and bee species for a single sample. The sample is the one which has the largest number of bee species that were collected from plants. As can be seen in the figure below, the sample is very much in line with the figure above with the notable absence of Leucanthemum vulgare.
Note that we have included bee species which have not been properly classified as native nor non-native in the figure below. As such, we see the presence of Melissodes subillatus.
## find the sample with the highest number of bee species
# extract only the data collected from plants but without removing the uncategorized bee species
data_no_air = data[data['plant_species'] != 'None']
max_samp = data_no_air[data_no_air['species_num'] == data_no_air['species_num'].max()]['sample_id'].head(1).values
bee_plant = data_no_air[data_no_air['sample_id'] == max_samp[0]].pivot_table(index=['plant_species'], columns='bee_species', values='nonnative_bee', aggfunc=lambda x: (1 ** x).sum(), fill_value=0) # please do not judge my aggregation function too harshly
## plot a heatmap
htmp = sns.heatmap(bee_plant, annot=True)
htmp.set_ylabel('Plant Species')
htmp.set_xlabel('Bee Species')
htmp.set_title('Plants Visited by Bees in Sample with Most Bee Species (Excluding Collected in Air)')
plt.show()Conclusions
Based on this data, I recommend that the agency supports Leucanthemum vulgare given its overwhelming popularity among native bees during the early season. Furthermore, I recommend Cichorium Intybus and Camaecrista fasciculata as they are favored during the late season. These three together would then support the native bees throughout the entire season.