<commit_before># -*- coding: utf-8 -*-
"""
Created on Wed Mar 23 01:24:48 2016
Bootstrap a distribution of mom bud positions
@author: sweel_rafelski
"""
import sys
import os
import os.path as op
import cPickle as pickle
import matplotlib.pyplot as plt
import scipy.stats as sp
import numpy as np
#from mayavi import mlab
import pandas as pd
import seaborn as sns
from tvtk.api import tvtk
from mombud.vtk_viz import vtk_mbfuncs as vf
import wrappers as wr
# pylint: disable=C0103
# pylint: disable=maybe-no-member
plt.rcParams['font.family'] = 'DejaVu Sans'
plt.close('all')

#datadir = op.join(os.getcwd(), 'data', 'transformedData')
datadir = ("C:\\Users\\sweel_rafelski\\Documents\\GitHub\\sweepython\\WorkingData\\data\\transformedData")


def boot(X, p, N):
    """
    Bootstrap the cell values at column p by shuffling the indices

    Parameters
    ----------
    X : DataFrame
        Pandas dataframe to be sampled/bootstrapped
    p : str
        Column name to be shuffled
    N : Int
        Number of bootstrap runs
    Returns
    -------
    result :  list
        List of shuffled vals from column selected by p

    """
    result = []
    for _ in range(N):
        rX = X.ix[:, p].sample(n=len(X), replace=True)
#        idx = rX.index.tolist()
        result.append(rX.values)
    return result


def cellpos(cellname, df, **kwargs):<commit_msg>boootcompare wip gen<commit_after># -*- coding: utf-8 -*-
"""
Created on Wed Mar 23 01:24:48 2016
Bootstrap a distribution of mom bud positions
@author: sweel_rafelski
"""
import sys
import os
import os.path as op
import cPickle as pickle
import matplotlib.pyplot as plt
import scipy.stats as sp
import numpy as np
#from mayavi import mlab
import pandas as pd
import seaborn as sns
from tvtk.api import tvtk
from mombud.vtk_viz import vtk_mbfuncs as vf
import wrappers as wr
# pylint: disable=C0103
# pylint: disable=maybe-no-member
plt.rcParams['font.family'] = 'DejaVu Sans'
plt.close('all')

#datadir = op.join(os.getcwd(), 'data', 'transformedData')
datadir = ("C:\\Users\\sweel_rafelski\\Documents\\GitHub\\sweepython\\WorkingData\\data\\transformedData")


def boot(X, p, N):
    """
    Bootstrap the cell values at column p by shuffling the indices

    Parameters
    ----------
    X : DataFrame
        Pandas dataframe to be sampled/bootstrapped
    p : str
        Column name to be shuffled
    N : Int
        Number of bootstrap runs
    Returns
    -------
    result :  list
        List of shuffled vals from column selected by p

    """
    result = []
    for _ in range(N):
        rX = X.ix[:, p].sample(n=len(X), replace=True)
#        idx = rX.index.tolist()
        result.append(rX.values)
    return result

def bstrp(X, N):
    n=0
    while n<N:
        yield np.random.permutation(X)
        np.random.randint




def cellpos(cellname, df, **kwargs):
{'fraction_non_alphanumeric': 0.11407511407511407, 'fraction_numerical': 0.012285012285012284, 'mean_word_length': 2.877551020408163, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6920858', 'n_tokens_mistral': 1005, 'n_tokens_neox': 942, 'n_words': 306}