Skip to content

Instantly share code, notes, and snippets.

View dgarana's full-sized avatar
🎯
Focusing

David Garaña Peña dgarana

🎯
Focusing
View GitHub Profile
@jennyd
jennyd / falcon-logging-middleware.py
Last active February 11, 2024 22:09
Falcon logging middleware
import falcon
import logging
logger = logging.getLogger(__name__)
logger.addHandler(logging.FileHandler('test.log'))
logger.setLevel(logging.INFO)
class ResponseLoggerMiddleware(object):
def process_response(self, req, resp):
logger.info('{0} {1} {2}'.format(req.method, req.relative_uri, resp.status[:3]))
@bsweger
bsweger / useful_pandas_snippets.md
Last active April 19, 2024 18:04
Useful Pandas Snippets

Useful Pandas Snippets

A personal diary of DataFrame munging over the years.

Data Types and Conversion

Convert Series datatype to numeric (will error if column has non-numeric values)
(h/t @makmanalp)