Skip to content

Commit 61612de

Browse files
committed
no iteration needed
1 parent 3ecc275 commit 61612de

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

Diff for: docs/source/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
author = 'Jee Vang'
2323

2424
# The full version, including alpha/beta/rc tags
25-
release = '3.0.4'
25+
release = '3.0.5'
2626

2727

2828
# -- General configuration ---------------------------------------------------

Diff for: pypair/contingency.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -1997,18 +1997,16 @@ def add_count(x, y):
19971997

19981998
@staticmethod
19991999
def _to_categorical_counts(a, b, a_vals=None, b_vals=None):
2000-
df = pd.DataFrame([(x, y) for x, y in zip(a, b)], columns=['a', 'b'])
2000+
df = pd.DataFrame({'a': a, 'b': b})
20012001

20022002
a_values = []
20032003
b_values = []
20042004

20052005
if a_vals is None:
2006-
a_values = list(df.a.unique())
2007-
a_values = sorted([v for v in a_values if pd.notna(v)])
2006+
a_values = sorted([v for v in df.a.unique() if pd.notna(v)])
20082007

20092008
if b_vals is None:
2010-
b_values = list(df.b.unique())
2011-
b_values = sorted([v for v in b_values if pd.notna(v)])
2009+
b_values = sorted([v for v in df.b.unique() if pd.notna(v)])
20122010

20132011
table = [[df.query(f'a=="{x}" and b=="{y}"').shape[0] + 1 for y in b_values] for x in a_values]
20142012
return table

Diff for: setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name='pypair',
8-
version='3.0.4',
8+
version='3.0.5',
99
author='Jee Vang',
1010
author_email='vangjee@gmail.com',
1111
packages=find_packages(exclude=('*.tests', '*.tests.*', 'tests.*', 'tests')),

0 commit comments

Comments
 (0)