Skip to main content

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

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybeepop-0.1.3.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pybeepop-0.1.3-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file pybeepop-0.1.3.tar.gz.

File metadata

  • Download URL: pybeepop-0.1.3.tar.gz
  • Upload date:
  • Size: 16.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.4

File hashes

Hashes for pybeepop-0.1.3.tar.gz
Algorithm Hash digest
SHA256 fde6c00a1e1b20a683ce439eff95a9dca2764f672974ee60d4bdd2d29f3432ec
MD5 3f8a996ee36cc50d936a7445f4b0c7ab
BLAKE2b-256 0d012bfc280b527eefc4772850f5f667af83b5f02511c4dde66e54066b558b4e

See more details on using hashes here.

File details

Details for the file pybeepop-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: pybeepop-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.4

File hashes

Hashes for pybeepop-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c25dc0e78b464de25a31197a9d84e76103481326c9a51301eb26fe36af5cb02b
MD5 140c54ccb6e6b47810ff00402d8d6ea2
BLAKE2b-256 cfe387683fcc00b5c5495bdcc860e147f380338794b11fd83d6ee1b5c71d30b9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page