Skip to content

Instantly share code, notes, and snippets.

View amdevine's full-sized avatar

Amanda Devine amdevine

  • Washington, D.C.
View GitHub Profile
@amdevine
amdevine / dc_python_ecology_1.md
Last active August 30, 2021 19:23
Data Carpentry: Python Day 1

Data Carpentry: Python Day 1

These notes are adapted from the official Carpentries documentation for Data Analysis and Visualization in Python for Ecologists: Before we start. They have been reordered, and some material has been expanded on, and there are some Smithsonian-specific details incorporated. The original lessons are licensed under CC-BY 4.0 2018–2020 by The Carpentries. These adapted notes are available for use under the same license.

Links

Official lesson link: https://datacarpentry.org/python-ecology-lesson/

Jupyter documentation: https://datacarpentry.org/python-ecology-lesson/jupyter_notebooks/

@amdevine
amdevine / dc_sql_ecology.md
Last active August 12, 2020 11:22
Data Carpentry: SQL
@amdevine
amdevine / ecoregion_70.geojson
Last active March 20, 2020 20:11
Spalding Ecoregion 70: Floridian. First file is original ER 70, second file is ER 70 with terrestrial Florida subtracted (resolution of 500k), third file is ER 70 with terrestrial Florida subtracted (resolution of 20m).
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@amdevine
amdevine / translate.ipynb
Created February 12, 2021 21:25
Translate characters to strings in Python with `str.maketrans()` and `str.translate()`
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@amdevine
amdevine / readme.md
Last active February 22, 2021 16:23 — forked from maartenzam/readme.md
World Tile Grid Map in ggplot2
@amdevine
amdevine / surveys2001.csv
Created March 2, 2021 07:30
Surveys 2001 and 2002
record_id month day year plot_id species_id sex hindfoot_length weight
31711 1 21 2001 1 PB F 26.0 25.0
31712 1 21 2001 1 DM M 37.0 43.0
31713 1 21 2001 1 PB M 29.0 44.0
31714 1 21 2001 1 DO M 34.0 53.0
31715 1 21 2001 2 OT M 20.0 27.0
31716 1 21 2001 2 RM M 17.0 11.0
31717 1 21 2001 2 NL M 33.0 121.0
31718 1 21 2001 2 DM F 34.0 44.0
31719 1 21 2001 2 PB M 26.0 42.0
@amdevine
amdevine / consolidate-rows.R
Last active March 9, 2021 05:04
Consolidate multiple household records into one household record
# Use dplyr package
library(dplyr)
# Create example data frame
data <- data.frame(personal_id = c(1, 2, 3, 4, 5, 6),
name = c('Albert', 'Beth', 'Cindy', 'David', 'Eugene', 'Fred'),
household_id = c('1H', '1H', '2H', '2H', '3H', '3H'),
score1 = c(3, NA, 1, NA, 1, NA),
score2 = c(5, NA, NA, 2, 2, NA),
score3 = c(NA, 'banana', 'cherry', NA, 'eggplant', NA),
@amdevine
amdevine / df-rename-columns-index.ipynb
Created March 31, 2021 02:17
Modify Pandas DataFrame column and index labels with functions
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@amdevine
amdevine / tracheophyta.md
Created June 2, 2021 16:58
Tracheophyte Taxa

Taxa of Tracheophytes

This gist contains plant taxa considered tracheophytes for resources that do not recognize "Tracheophyta" as a division.

BOLD

Division Tracheophyte?
Bryophyta No
Chlorophyta No
@amdevine
amdevine / encode-dummy-variables.ipynb
Created September 23, 2021 04:32
Encode dummy variables with dplyr
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.