-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
ENH: add expression evaluation functionality via eval #4162
Conversation
excellent. can i rebase and push ... not sure if that's going to cause a bunch of merge conflicts when you pull down...? |
go ahead and try..... |
looks ok to me |
actually it interleaved our commits (which is actually correct) |
u could pull down without any pain? |
yeah i know that was nice |
and travis working on it.....and i think you rebased off of current master...as using thew travis scheme :) |
i did |
well actually |
this (hard case) will be needed i think....sorry. i guess there's really no way to recover gracefully if you've squashed or fixed up things. won't do anymore....maybe we should just wait until we're finished to do that... |
I think we can rebase our own commits without too much problems? not a big deal to rebase at the end (or as long as we coordinate) |
hmm.....actuall my history is now different that the main branch, I don't see the reorderd commits.....?? (mine are in the original order) |
did u get a big merge commit when you pulled? that's the issue...i rewrote history so i think then git finds the nearest parent and tries to merge since it can't know that i deleted N commits in between ... probably least confusing to just wait until the end to squash |
hm you're right i see the same thing my original order
|
http://git-scm.com/book/en/Distributed-Git-Contributing-to-a-Project I don't think we can rebase at all...just pull/push/merge |
why don't you create a commit and try pushing...then i'll do the same |
it's annoying that the embedded HTML travis tag on github says failing when pushed a commit... |
arg it's a stupid network yahoo test failure... |
i pulled down your commit....what am I donig wrong?
|
force push it |
I have something wrong it updated to the |
hm why not just do |
I did that.... git push doesn't do anything then....hmmm |
ok how about |
merged into master? that doesn't seem like a great idea just yet... |
oh nevermind something else is going on |
no....it didn't actually merge |
yeh...that's weird...nothing showed up...hmmm (I didn't mean to do that)...but I am not sure what actually happened |
in my eval5 branch this is what I did
|
it looks like it merged master back into this branch somehow.... see if you can resurrect somehow (maybe create a new branch).. I don't think master actually changed.. |
closes #3393.
cc @jreback
eval
RoadmapPyTables
allows natural syntax for queries, with in-line variables allowed
some examples
"ts>=Timestamp('2012-02-01') & users=['a','b','c']"
['A > 0']
Todos:
|
and~
operators, and invalid filter expressionsExpr
base class to opt in/out of allowed operations(e.g.
Numexpr
doesn't want to allow certain operations, butPyTables
needs them,so maybe define in the base class for simplicity, and just not allow them (checked in
visit
),which right now doesn't allow a
generic_visitor
)ops.Value
be equiv ofops.Constant
?Documentation
eval
docstringx = 3; y = 2; pd.eval('x // y', engine='python')
is 1000 times slower than the same operation in actual Python.Engines
eval('os.system("sudo rm -rf /")')
) is possible hereShould python be the default engine for small frames?
Functions
isexpr
eval
to top-level pandasError Handling
Alignment
'python'
engine when aSeries
andDataFrame
both haveDatetimeIndexes
(I would rather not do this and just enforce the to-be-deprecated index-aligning-if-both-indices-are-datetimeindex behavior)PeriodIndex
es don't work (well, they won't pass my tests) because of a stack overflow bug when joining aDatetimeIndex
and aPeriodIndex
(that bug is slated for 0.13, but a design decision needs to be made)NDFrame
(is this really necessary?)Scope
Expr
objects to be passed toeval
(Expr
will pull in the local and global variables from the calling stack frame)Miscellaneous
evaluate
functionExpr
inNDFrame.__getitem__
cc @jrebackdf + df2
should return aDataFrame
ifdf
anddf2
are bothDataFrame
objects.Expression
toExpr
truediv
keyword toExpr
, default toTrue
Operators
%
**
Tests
DatetimeIndex
andPeriodIndex
objects are untested because of a few join and alignment issues.//
operator works as it should (it works, but there may be edge cases that I haven't though of yet)//
numexpr
only supports scalar evaluation here: variables are not allowed so this will always eval in python space (half-assed it a bit in the tests here need to fix that)**
associativity issue in testingNear Future
and
,or
andnot
aliases for the operators&
,|
and~
, respectivelydf.A
syntaxsum
andprod
)Far Future