Skip to main content

pybeepop

codecov

Assessing the Influence of Pesticide Usage, Parasitic Factors, and Climate on Honey Bee Populations in the United States (2015-2019)

Installation

$ pip install pybeepop

Usage

The pybeepop has 4 modules ("analysis", "clean_data", "eda", and "to_ddl"), with the goal of analyzing the bee population project.

from pybeepop.analysis import *
from pybeepop.clean_data import *
from pybeepop.eda import *
from pybeepop.to_ddl import *

# read the raw data

data1_path_origin = '../tests/data/original/average_monthly_temperature_by_state_1950-2022.parquet'
data2_path_origin = '../tests/data/original/epest_county_estimates.parquet'
data3_path_origin = '../tests/data/original/save_the_bees.parquet'
data4_path_origin = '../tests/data/original/pollution_2000_2021.parquet'

data1, data2, data3, data4 = read_data(data1_path_origin, data2_path_origin, data3_path_origin, data4_path_origin)

# Write the sql file and load it to database

sql_path = "../tests/scripts/output.sql"
temperature_data_path = "../tests/data/processed/average_monthly_temperature_by_state_1950-2022.csv"

init_tables(sql_path)
create_sql_MonitorStation(temperature_data_path, sql_path)
connection = connect_to_db(3307, 'localhost')
load_sql_to_db(connection, sql_path)

# fetch data from the database and return it as a dataframe

query_monitor_station = """
    SELECT *
    FROM MonitorStation
"""
columns_monitor_station = ['CentroidLongitude', 'CentroidLatitude', 'Year', 'AverageTemperature']
monitor_station_df = query_transform_dataframe(connection, query_monitor_station, columns_monitor_station)

# combine plots into 2 x 2 scale

concat_plots(Illinois_plot_1, Massachusetts_plot_1, Kansas_plot_1, Georgia_plot_1, loss_disease_parasite_path)

# check variance inflation factor (VIF)

vif_path = "../tests/data/processed/vif.csv"
check_vif(data)

# check and generate correlation matrix

correlation_path = "../tests/images/correlation_matrix.png"
correlation(data, correlation_path)

# run linear and non-linear models

linear_model_path = "../tests/models/linear_model.pkl"
shap_train_path = "../tests/images/shap_train.png"
shap_overall_path = "../tests/images/shap_overall.png"
X, y, model = linear_model(data, linear_model_path)
non_linear_model(X, y, shap_train_path, shap_overall_path)

Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

License

pybeepop was created by Hanlin Zhao. It is licensed under the terms of the MIT license.

Credits

pybeepop was created with cookiecutter and the py-pkgs-cookiecutter template.

Metadata

Release files for pybeepop 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pybeepop 0.1.3
File Size Uploaded
pybeepop-0.1.3.tar.gz 16.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pybeepop 0.1.3
File Interpreter ABI Platform
pybeepop-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 34.3 kB

Release files / pybeepop-0.1.3.tar.gz

Download URL pybeepop-0.1.3.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fde6c00a1e1b20a683ce439eff95a9dca2764f672974ee60d4bdd2d29f3432ec
BLAKE2b-256 checksum
How to use checksums
0d012bfc280b527eefc4772850f5f667af83b5f02511c4dde66e54066b558b4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.4

Release files / pybeepop-0.1.3-py3-none-any.whl

Download URL pybeepop-0.1.3-py3-none-any.whl
Size 17.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c25dc0e78b464de25a31197a9d84e76103481326c9a51301eb26fe36af5cb02b
BLAKE2b-256 checksum
How to use checksums
cfe387683fcc00b5c5495bdcc860e147f380338794b11fd83d6ee1b5c71d30b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.4

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page