forked from pandas-dev/pandas
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* master: (313 commits) TST: more Python 2.5 sadness TST: Python 2.5 float formatting changed TST: cast to i8 when checking margins BUG: DataFrame.join on keys produce wrong result, does not preserve order DOC: release notes ENH: xs level can take multiple levels, pass multiple levels to MultiIndex.droplevel, GH pandas-dev#371 BUG: fix bugs related to comments in pandas-dev#371 BUG: fix TextParser with list buglet, enable parsing of DataFrame output with index names BUG: convert tuples in concat to MultiIndex BUG: don't lose index names when adding row margin ENH: add margins to crosstab ENH: add crosstab function and test ENH: crosstab prototype function, API needs fleshing out, GH pandas-dev#170 BUG: fix buglet with xs with level, GH pandas-dev#371 TST: add test_sql.py module TST: testing, cleanup of io.sql module TST: indexing testing with minor Series.__getitem__ refactoring ENH: hack toward pandas-dev#629 BUG: check for non-contiguous memory in SeriesGrouper, causing segfault ENH: add ability to pass list of dicts to DataFrame.append (GH pandas-dev#464) ...
- Loading branch information
Showing
139 changed files
with
16,081 additions
and
4,680 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
from pandas import * | ||
from pandas.util.testing import rands | ||
|
||
import string | ||
import random | ||
|
||
k = 20000 | ||
n = 10 | ||
|
||
foo = np.tile(np.array([rands(10) for _ in xrange(k)], dtype='O'), n) | ||
foo2 = list(foo) | ||
random.shuffle(foo) | ||
random.shuffle(foo2) | ||
|
||
df = DataFrame({'A' : foo, | ||
'B' : foo2, | ||
'C' : np.random.randn(n * k)}) | ||
|
||
import pandas._sandbox as sbx | ||
|
||
def f(): | ||
table = sbx.StringHashTable(len(df)) | ||
ret = table.factorize(df['A']) | ||
return ret | ||
def g(): | ||
table = sbx.PyObjectHashTable(len(df)) | ||
ret = table.factorize(df['A']) | ||
return ret | ||
|
||
ret = f() | ||
|
||
""" | ||
import pandas._tseries as lib | ||
f = np.std | ||
grouped = df.groupby(['A', 'B']) | ||
label_list = [ping.labels for ping in grouped.groupings] | ||
shape = [len(ping.ids) for ping in grouped.groupings] | ||
from pandas.core.groupby import get_group_index | ||
group_index = get_group_index(label_list, shape).astype('i4') | ||
ngroups = np.prod(shape) | ||
indexer = lib.groupsort_indexer(group_index, ngroups) | ||
values = df['C'].values.take(indexer) | ||
group_index = group_index.take(indexer) | ||
f = lambda x: x.std(ddof=1) | ||
grouper = lib.Grouper(df['C'], np.ndarray.std, group_index, ngroups) | ||
result = grouper.get_result() | ||
expected = grouped.std() | ||
""" |
Oops, something went wrong.