pyparsing / plusminus Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
I'd like there be an option like parser = BaseArithmeticParser(numerical_types=[int, Decimal, complex])
where if numerical_types=None
it would default to the value numerical_types=[int, float, complex]
so that when I'm dealing with monetary values I can be confident that the answer IS EXACT, not really super close.
Deleted
The result of below code evaluation should be true, but it returns False instead.
from plusminus import BaseArithmeticParser
parser = BaseArithmeticParser()
parser.evaluate('False or False or True')
I'm trying to use this project in a spark distributed environment, but encountered a "RecursionError: maximum recursion depth exceeded". After some debugging, I found this is because the parser and parsed_rule can not be de-serialized.
Below is a sample code to reproduce the error:
import cloudpickle
from plusminus import ArithmeticParser
parser = ArithmeticParser()
parsed_res = parser.parse(' A + B')
parsed_pair = cloudpickle.dumps((parser, parsed_res))
parser, parsed_res = cloudpickle.loads(parsed_pair)
Hi,
Thanks for your great work on pyparsing and plusminus.
I am searching for a parser working on pandas Series with variables.
This looks to work out of the box with plusminus (mapping all series of a dataframe to variables)
For a 1:1 adaption it would be fine to have a different identifier definition.
As the data columns i am working (they come from external CSV) on may contain spaces i would like to define a variable as
var_name = pp.QuotedString('[', endQuoteChar=']').setName("identifier")
which currently requires a copy and paste of your library.
Christoph
plusminus
is a project of 2 minds:
eval()
|x|
for abs(x)
)These two goals should be split into separate parser classes, so that "programming-ish" concepts do not necessarily bleed over into arithmetic notations, and arithmetic expressions like |x|
are not included in safe Python eval()
support.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.