"Python" (External Evaluation System)
- Python 2.6+ and Python 3.4+ are supported.
- To configure Python for use in the Wolfram Language, follow the instructions from the Configure Python for ExternalEvaluate workflow.
- Not all Python built-in types are supported. The supported Python types are:
bool True|False Boolean values array NumericArray arrays (from the NumPy library) bytearray ByteArray sequence of integers 0-255 bytes ByteArray immutable sequence of integers 0-255 complex Complex complex number date DateObject specific calendar date datetime DateObject specific date with time granularity Decimal Real arbitrary-precision real number dictionary Association association of keys and values float Real real-valued number Fraction Rational fraction object from the fractions module frozenset List unordered immutable set of unique values Image Image image (from Python PIL library) int Integer arbitrary-sized integer list List sequence of values long Integer arbitrary-sized integer None Null null value set List unordered set of unique values str String sequence of character values tuple List ordered sequence of values
- The precision of a Real returned from a Decimal object is maintained when returned from ExternalEvaluate.
- Python complex types are required to be real, and so any Complex expression returned from ExternalEvaluate will have real-valued components.
Examplesopen allclose all
Basic Examples (1)
Type > to get a Python code cell that uses ExternalEvaluate to evaluate:
Introduced in 2018