The package manager of python packages is called pip.
sudo apt-get install python-pip
If you need a pip package as a debian you can use Victor's debian from pip.
from Tkinter import * | |
import ttk | |
class MainWindow(Frame): | |
def __init__(self): | |
Frame.__init__(self) | |
self.master.title("ProgressBar example") | |
#self.master.minsize(400, 100) | |
self.grid(sticky=E+W+N+S) |
The package manager of python packages is called pip.
sudo apt-get install python-pip
If you need a pip package as a debian you can use Victor's debian from pip.
#!/usr/bin/env python | |
""" | |
Tropical Cyclone Risk Model (TCRM) - Version 1.0 (beta release) | |
Copyright (C) 2011 Geoscience Australia | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. |
def splitDataFrameList(df,target_column,separator): | |
''' df = dataframe to split, | |
target_column = the column containing the values to split | |
separator = the symbol used to perform the split | |
returns: a dataframe with each entry for the target column separated, with each element moved into a new row. | |
The values in the other columns are duplicated across the newly divided rows. | |
''' | |
def splitListToRows(row,row_accumulator,target_column,separator): | |
split_row = row[target_column].split(separator) |
from scipy.spatial.distance import pdist, squareform | |
import numpy as np | |
import copy | |
def distcorr(Xval, Yval, pval=True, nruns=500): | |
""" Compute the distance correlation function, returning the p-value. | |
Based on Satra/distcorr.py (gist aa3d19a12b74e9ab7941) | |
>>> a = [1,2,3,4,5] |
#!/usr/bin/python | |
import sys; | |
import re; | |
import slate; | |
import pickle; | |
import nltk; | |
import glob; | |
import os; |
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)