Skip to content

Instantly share code, notes, and snippets.

View adyork's full-sized avatar

Amber York adyork

  • Woods Hole Oceanographic Institution
  • Woods Hole/N Falmouth, MA
View GitHub Profile
@adyork
adyork / get_flat_header.py
Last active February 15, 2019 16:44
Flatten column names (take multiple column names and flatten to one list)
'''
get_flat_header(group_results)
get_flat_header(group_results,combine=True)
* For use with pandas .groupby() and .agg() results
* For when you get back multilevel headers, and you just want one header list .
* Returns list of column names.
if combine=False (default), then it returns the column name as the last name in the list for that column.
e.g.
@adyork
adyork / api-examples-randomfox-ipynb.ipynb
Last active October 20, 2022 16:02
API-examples-randomfox. ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adyork
adyork / full_gnrd_test.ipynb
Last active October 20, 2022 16:07
full_gnrd_test.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adyork
adyork / taxamatch_response_data.ipynb
Last active October 20, 2022 16:09
taxamatch_response_data.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adyork
adyork / species_erddap_csv.ipynb
Last active October 20, 2022 16:01
species_erddap_csv.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adyork
adyork / species_erddap_json.ipynb
Last active October 20, 2022 16:01
species_erddap_json.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adyork
adyork / match_names_gnrd.ipynb
Last active October 20, 2022 15:26
match_names_gnrd.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adyork
adyork / read_netcdf.ipynb
Last active October 20, 2022 15:58
read_netcdf.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@adyork
adyork / read_netcdf.ipynb
Last active October 20, 2022 15:57
read_netcdf.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
%% DateTime transformations
% goals:
% * add time zone to datetime
% * convert to ISO_DateTime_UTC
% * convert to ISO_DateTime_local
% * get epoch time (seconds since 1970)
% * check epoch conversion
%starting with a matlab datenum format (no time zone). But we know it is local (Mountain Time) timezone.
datenum = DATA.Time; %in this data structure DATA.Time is a time with seconds resolution (no time zone in datenum)