A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
| from __future__ import with_statement | |
| from alembic import context | |
| from sqlalchemy import engine_from_config, pool | |
| from logging.config import fileConfig | |
| from models import Base | |
| config = context.config | |
| fileConfig(config.config_file_name) |
| #!/usr/bin/env python | |
| """ | |
| Provide useful alembic information after switching branches. | |
| """ | |
| import argparse | |
| import subprocess | |
| import os | |
| import os.path | |
| import py.path |
| #!/usr/bin/env python | |
| """ | |
| no more embarrasing "removed pdb, sorry" commits | |
| install | |
| ------- | |
| save it as .git/hooks/pre-commit giving +x permission | |
| """ |
| #!/bin/env python | |
| # This work is licensed under the terms of the MIT license. | |
| # For a copy, see <https://opensource.org/licenses/MIT>. | |
| """ | |
| A hook to git that removes orphan files "*.pyc" and "*.pyo" for "*.py" | |
| beeing deleted or renamed by git checkout. It also removes their empty parent | |
| directories. | |
| Place it to "my_local_repository/.git/hooks/post-checkout" and make it executable. | |
| Nothing is cleaned for .py files deleted manually or by "git rm" etc. | |
| Related to http://stackoverflow.com/q/1504724/448474 |
A personal diary of DataFrame munging over the years.
Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)
| #!/usr/bin/env python | |
| """ | |
| Provide useful alembic information after switching branches. | |
| """ | |
| import argparse | |
| import subprocess | |
| import os | |
| import os.path | |
| import py.path |
| #!/bin/bash | |
| ############## | |
| # PRELIMINARIES | |
| ############## | |
| user=$(id -u) | |
| INSTALL_PATH="$HOME/Popcorn-Time" | |
| DESKTOP_PATH="$HOME/.local/share/applications" | |
| ICON_PATH="$HOME/.local/share/icons/hicolor/256x256/apps" |
| import random | |
| girls = '''Júlia Sophia Isabella Manuela Giovanna Alice Laura | |
| Luiza Beatriz Mariana Yasmin Gabriela Rafaela Isabelle Lara | |
| Letícia Valentina Nicole Sarah Vitória Isadora Lívia Helena | |
| Lorena Clara Larissa Emanuelly Heloisa Marina Melissa Gabrielly | |
| Eduarda Rebeca Amanda Alícia Bianca Lavínia Fernanda Ester | |
| Carolina Emily Cecília Pietra Milena Marcela Laís Natália | |
| Maria Bruna Camila Luana Catarina Olivia Agatha Mirella | |
| Sophie Stella Stefany Isabel Kamilly Elisa Luna Eloá Joana | |
| Mariane Bárbara Juliana Rayssa Alana Caroline Brenda Evelyn |
| import time | |
| import re | |
| import unicodedata | |
| ''' | |
| listado de palabras que quiero descartar | |
| ''' | |
| pal_comunes = ['los','las','sin','con','tan','por'] | |
| lista_categorias = ['lacteos','comestibles','auto','hogar'] | |
| lista_productos = ['leche','huevo','aceite','yerba'] |
| # iPython Notebook with per-user storage and config | |
| # | |
| # Based on crosbymichael/ipython | |
| # Creates a Docker image with IPython Notebook installed. | |
| # | |
| # It expects to be run like this: | |
| # | |
| # docker run -v /home/eduard/notebooks/eduard:/notebooks benthoo/ipython-user | |
| # | |
| # You provide a folder per user on the host system. This folder will hold the users notebooks and also needs to contain the |