Skip to content

add rand, ror, rxor methods to frame #4331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cpcloud opened this issue Jul 23, 2013 · 5 comments · Fixed by #5022
Closed

add rand, ror, rxor methods to frame #4331

cpcloud opened this issue Jul 23, 2013 · 5 comments · Fixed by #5022
Labels
API Design Enhancement Numeric Operations Arithmetic, Comparison, and Logical operations
Milestone

Comments

@cpcloud
Copy link
Member

cpcloud commented Jul 23, 2013

In [11]: s = True

In [12]: df = DataFrame(rand(10, 5)> 0.5)

In [13]: df
Out[13]:
       0      1      2      3      4
0   True  False  False   True  False
1   True  False  False   True  False
2  False  False   True  False  False
3   True  False  False   True  False
4  False  False   True   True  False
5  False  False  False   True   True
6   True   True  False   True   True
7   True   True  False  False   True
8   True   True   True   True  False
9  False  False   True  False  False

In [14]: s & df
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-14-cab092ff8433> in <module>()
----> 1 s & df

TypeError: unsupported operand type(s) for &: 'bool' and 'DataFrame'

In [15]: df & s
Out[15]:
       0      1      2      3      4
0   True  False  False   True  False
1   True  False  False   True  False
2  False  False   True  False  False
3   True  False  False   True  False
4  False  False   True   True  False
5  False  False  False   True   True
6   True   True  False   True   True
7   True   True  False  False   True
8   True   True   True   True  False
9  False  False   True  False  False
@jtratner
Copy link
Contributor

I'll add this with #4051 - - 2 line change to put this in for all objects.
(I think it might already have it... Not sure)
On Jul 23, 2013 3:52 PM, "Phillip Cloud" [email protected] wrote:

In [11]: s = True

In [12]: df = DataFrame(rand(10, 5)> 0.5)

In [13]: df
Out[13]:
0 1 2 3 4
0 True False False True False
1 True False False True False
2 False False True False False
3 True False False True False
4 False False True True False
5 False False False True True
6 True True False True True
7 True True False False True
8 True True True True False
9 False False True False False

In [14]: s & df

TypeError Traceback (most recent call last)
in ()
----> 1 s & df

TypeError: unsupported operand type(s) for &: 'bool' and 'DataFrame'

In [15]: df & s
Out[15]:
0 1 2 3 4
0 True False False True False
1 True False False True False
2 False False True False False
3 True False False True False
4 False False True True False
5 False False False True True
6 True True False True True
7 True True False False True
8 True True True True False
9 False False True False False


Reply to this email directly or view it on GitHubhttps://github.com//issues/4331
.

@cpcloud
Copy link
Member Author

cpcloud commented Jul 24, 2013

oh excellent ill close the pr then

@jreback
Copy link
Contributor

jreback commented Sep 27, 2013

@jtratner part of your numeric refactor? #4051 I think?

@jtratner
Copy link
Contributor

yes. But you can leave it open for now - just to make sure I remember.

@jtratner
Copy link
Contributor

Fixed by #5022 (but still not available as flex methods)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Design Enhancement Numeric Operations Arithmetic, Comparison, and Logical operations
Projects
None yet
3 participants