Skip to content

Conversation

@carroux
Copy link
Contributor

@carroux carroux commented Feb 18, 2016

A hidden code snippet uses tm.choice() when it should use np.random.choice()

A hidden code snippet uses `tm.choice()` when it should use `np.random.choice()`
@carroux
Copy link
Contributor Author

carroux commented Feb 18, 2016

@TomAugspurger
Copy link
Contributor

@carroux thanks!

@jreback jreback added this to the 0.18.0 milestone Feb 18, 2016
@jreback
Copy link
Contributor

jreback commented Feb 18, 2016

so I think this was for numpy < 1.7 compat.

pls remove this: https://github.com/pydata/pandas/blob/master/pandas/util/testing.py#L173

as well (its possible there are some other references as well), pls search the docs; in the code I think something will fail.

thanks!

@jreback jreback added the Clean label Feb 18, 2016
@jreback
Copy link
Contributor

jreback commented Feb 18, 2016

oh, saw @TomAugspurger merged this, ok. then.

@TomAugspurger
Copy link
Contributor

Ha, sorry bout that. FYI

pandas/tests/frame/test_query_eval.py 99: a = tm.choice(['red', 'green'], size=10) 100: b = tm.choice(['eggs', 'ham'], size=10) 152: a = tm.choice(['red', 'green'], size=10) 153: b = tm.choice(['eggs', 'ham'], size=10) 246: a = tm.choice(['red', 'green'], size=10) 978: a = Series(tm.choice(list('abcde'), 20)) pandas/tests/test_graphics_others.py 638: gender = tm.choice(['male', 'female'], size=n) 712: gender_int = tm.choice([0, 1], size=n) pandas/tests/test_graphics.py 63: gender = tm.choice(['Male', 'Female'], size=n) 64: classroom = tm.choice(['A', 'B', 'C'], size=n) 3864: gender = tm.choice(['male', 'female'], size=n) pandas/tools/tests/test_merge.py 239: df = DataFrame({'a': tm.choice(['m', 'f'], size=3), 241: df2 = DataFrame({'a': tm.choice(['m', 'f'], size=10), 248: df = DataFrame({'a': tm.choice(['m', 'f'], size=3), 251: df2 = DataFrame({'a': tm.choice(['m', 'f'], size=10), 257: df = DataFrame({'a': tm.choice(['m', 'f'], size=3), 259: df2 = DataFrame({'a': tm.choice(['m', 'f'], size=10), vb_suite/groupby.py 146:obj = tm.choice(list('ab'), size=n).astype(object)

are the other occurrences, if we want to open a cleanup issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants