Skip to content

Instantly share code, notes, and snippets.

@danilofreire
danilofreire / r-to-python-data-wrangling-basics.md
Created Jan 24, 2020 — forked from conormm/r-to-python-data-wrangling-basics.md
R to Python: Data wrangling with dplyr and pandas
View r-to-python-data-wrangling-basics.md

R to python data wrangling snippets

The dplyr package in R makes data wrangling significantly easier. The beauty of dplyr is that, by design, the options available are limited. Specifically, a set of key verbs form the core of the package. Using these verbs you can solve a wide range of data problems effectively in a shorter timeframe. Whilse transitioning to Python I have greatly missed the ease with which I can think through and solve problems using dplyr in R. The purpose of this document is to demonstrate how to execute the key dplyr verbs when manipulating data using Python (with the pandas package).

dplyr is organised around six key verbs:

@danilofreire
danilofreire / metropolis.css
Created Dec 5, 2019 — forked from vhodges/metropolis.css
A version of the Beamer theme Metropolis for reveal.js
View metropolis.css
/**
* A simple theme for reveal.js presentations, derived from serif.css
* It's in the spirit of the Metropolis theme for beamer https://github.com/matze/mtheme
*
* This theme is Copyright (C) 2016 Vince Hodges, http://sourdoughlabs.com - it is MIT licensed.
*/
@import url('https://fonts.googleapis.com/css?family=Fira+Sans');
.reveal a {
@danilofreire
danilofreire / docker-rm-images.md
Created Dec 1, 2019 — forked from alferov/docker-rm-images.md
Remove all (untagged) images and containers from Docker
View docker-rm-images.md
# Delete all containers
docker rm $(docker ps -aq)
# Delete all images
docker rmi $(docker images -q)
# Delete all untagged images
docker rmi $(docker images -q --filter "dangling=true")

References:

@danilofreire
danilofreire / gist:87eae7585dcccceda52f9dc5f3b08eeb
Created Jul 17, 2017 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View gist:87eae7585dcccceda52f9dc5f3b08eeb

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
View download_data_by_year.R
library(devtools)
devtools::install_github('RobertMyles/congressbr')
library(congressbr)
library(tidyverse)
library(stringr)
library(lubridate)
`%p%` <- function(e1,e2) return(paste0(e1,e2))
erros <- c()
download_year <- function(year) {
View gist:caccdaf3b23976bfe12d04be18c85434

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream