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)
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)
| """ | |
| Hinton diagrams in matplotlib. | |
| A Hinton diagram is useful for visualizing a matrix of signed weights. | |
| In the diagram, each matrix element is represented by a square whose | |
| color indicates the sign and whose area represents the magnitude. | |
| """ | |
| import matplotlib.patches as mpatches |
| #!/usr/bin/env python | |
| """ | |
| Convert camel-case to snake-case in python. | |
| e.g.: CamelCase -> snake_case | |
| Relevant StackOverflow question: http://stackoverflow.com/a/1176023/293064 | |
| """ |
| from django.conf import settings | |
| from django.http import HttpResponsePermanentRedirect, get_host | |
| class ForceSSLMiddleware(object): | |
| """ | |
| Redirects all (non-DEBUG) requests to go through SSL. | |
| Picks up the `HTTP_X_FORWARDED_PROTO` proxy header set by Heroku. | |
| Also sets the "Strict-Transport-Security" header for 600 seconds so that |
| """ | |
| This module implements the Lowess function for nonparametric regression. | |
| Functions: | |
| lowess Fit a smooth nonparametric regression curve to a scatterplot. | |
| For more information, see | |
| William S. Cleveland: "Robust locally weighted regression and smoothing | |
| scatterplots", Journal of the American Statistical Association, December 1979, |