Skip to content

Instantly share code, notes, and snippets.

View andersy005's full-sized avatar
:octocat:

Anderson Banihirwe andersy005

:octocat:
View GitHub Profile
# -*- coding: utf-8 -*-
""" Deletes all tweets below a certain retweet threshold.
"""
import tweepy
from datetime import datetime
# Constants
CONSUMER_KEY = ''
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
FROM pangeo/base-image:2020.03.27
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def preprocess(ds):
"""Drop all unnecessary variables and coordinates"""
vars_to_drop = [vname for vname in ds.data_vars if vname not in variables]
coord_vars = [vname for vname in ds.data_vars if 'time' not in ds[vname].dims or 'bound' in vname]
ds_fixed = ds.set_coords(coord_vars)
data_vars_dims = []
for data_var in ds_fixed.data_vars:
data_vars_dims.extend(list(ds_fixed[data_var].dims))
coords_to_drop = [coord for coord in ds_fixed.coords if coord not in data_vars_dims]
grid_vars = list(set(vars_to_drop + coords_to_drop) - set(['time', 'time_bound']))
@andersy005
andersy005 / data-science-process.md
Created April 13, 2020 16:55 — forked from jayascript/data-science-process.md
A basic outline of the steps I take to go from raw data to deployed model.

Data Science Process

Steps to take for a comprehensive analysis.

Stage 1: Define

Project background.

Step 1.1: Describe.