Skip to content

Instantly share code, notes, and snippets.

View henriquepgomide's full-sized avatar
:octocat:
Ediscere, Scire, Agere, Vincere

Henrique Gomide, Ph.D. henriquepgomide

:octocat:
Ediscere, Scire, Agere, Vincere
View GitHub Profile
@conormm
conormm / r-to-python-data-wrangling-basics.md
Last active April 24, 2024 18:22
R to Python: Data wrangling with dplyr and pandas

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:

@MrEliptik
MrEliptik / text_preprocessing.py
Created January 14, 2019 12:01
A python script to preprocess text (remove URL, lowercase, tokenize, etc..)
import re, string, unicodedata
import nltk
import contractions
import inflect
from nltk import word_tokenize, sent_tokenize
from nltk.corpus import stopwords
from nltk.stem import LancasterStemmer, WordNetLemmatizer
def replace_contractions(text):
"""Replace contractions in string of text"""
@miztiik
miztiik / add-multiple-remotes-to-git-repo.md
Last active December 26, 2023 13:22
Adding multiple remote url to git repo

Add Multiple Remotes URLs to git

Adding the first remote origin

git remote add origin remote_1_url
git remote set-url origin remote_1_url

# Set the default remote branch for the current local branch
git branch --set-upstream master
# or