Install the Rails gem if you haven't done so before
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
def anti_join(x, y, on): | |
"""Return rows in x which are not present in y""" | |
ans = pd.merge(left=x, right=y, how='left', indicator=True, on=on) | |
ans = ans.loc[ans._merge == 'left_only', :].drop(columns='_merge') | |
return ans | |
def anti_join_all_cols(x, y): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Run the following commands (bc. gists don't allow directories) | |
pip install flask django dj-database-url psycopg2 | |
mkdir -p app/migrations | |
touch app/__init__.py app/migrations/__init__.py | |
mv models.py app/ | |
python manage.py makemigrations | |
python manage.py migrate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: cp1252 -*- | |
''' | |
[Programación en Python] | |
''' | |
''' | |
Python tiene veintiocho palabras clave: | |
and continue else for import not raise | |
assert def except from in or return | |
break del exec global is pass try |