Setup and general usage#
XlCalcNet is a numerical library with parts written in Python and other parts written in C#, C++, C and Pascal, focussing on numerical calculations in multiple precision and data visualisation.
Since the main goal is to give access to software written in Python (or via PythonNet software written in C#) from within spreadsheet formulas, a dedicated CPython installation is strongly recommend, to make it easier to configure the interaction with Microsoft Excel, without disturbing existing Python installations.
The interaction with Microsoft Excel is achieved by running a socket server written in Python, which is called from spreadsheet formulas using the functionality provided by Excel.Dna.
The code which is necessary to make this work overall contains much more C# and C/C++ than Python, so the project is not really suitable as a project on PyPI, but is provided as a Github project only. Both the source code and precompiled binaries are included, since compiling all of the source code requires MSYS2, Free Pascal and Visual Studio, which not all Excel users will be familiar with.
On the Python side XlCalcNet uses Mpmath 4.0 to provide a rich set of functions in arbitrary precision, using not only Mpmath’s binary and interval data types, but also Python’s built-in Decimal and Fraction data types. If GMP2 is installed, its data types can be used in many cases instead of Mpmath’s binary data types, being much faster. Likewise, if Python-Flint is installed, its data types can be used in many cases instead of Mpmath’s interval data types, being much faster, and often also more accurate.
On the C/C++ side, XlCalcNet uses DAMath, Boost Math, Boost Multiprecision and Eigen to provide numerical functions in single, double, extended, quadruple and octuple precision, which are available to the user both from C# and Python.
The XlCalcNet2 library, which is licensed under the LGPL-3.0 and is therefore provided as a separate project, is based on Boost Math, Boost Multiprecision, Eigen, GMP, MPFR, MPC and Flint and provides functions for the same data types as XlCalcNet and also in arbitrary precision.
XlCalcNet is intended to be used together with existing Python libraries like NumPy, Matplotlib, Pandas, SciPy. It can also be used from recent versions of RStudio and R, using the reticulate package.
Setup and general usage
- Setting up XlCalcNet
- Downloading and installing the “right” version of CPython
- Installing and using Python.NET: Calling C# from Python
- Installing the DataXlCalcNet folder
- Installing XlCalcNet
- Installing XlCalcNet2 (optional)
- Installing and using the Tiny IDE as a Python application
- Installing and using of the MS Excel XlNet addin: first steps
- Reasons for using multiprecision arithmetic
- Reasons for calling C# from Python
- Rebuilding the .dll files of XlCalcNet and XlCalcNet2 from source code
- General and user interface functions
- Starting and calling the socket server
- Starting the output monitor
- Starting an additional instance of the IDE
- Starting the gallery of plots
- Starting the interactive 3D wpf plots
- Starting the data viewer
- Starting IDLE
- Functions related to folders
- Information about installation status of supporting python packages
- Information about context lists, and setting global precision
- Support for running interactive Matplotlib output in a separate process
- More on XlCalcNet with MS Excel
- Exploring with an example spreadsheet: simple formulas, multiple precision
- Exploring with an example spreadsheet: array formulas
- Exploring with an example spreadsheet: small Python programs, syntax rules
- Entering multi-precision data into a spreadsheet (text formatting and AsDouble)
- Managing procedures instead of functions
- Building a library of user defined python functions
- Building a library of user defined functions in C#
- Sphinx: building documentation for software with Python (html and pdf)
- Calling Python from C#
- Mathematical functions based on Mpmath, Gmpy2 and Python-Flint (only Python)
- Overview
- Double-precision arithmetic:
fpm - Binary floating-point with arbitrary-precision and exponent:
mpm - Interval arithmetic with arbitrary-precision and exponent:
ipm - Decimal floating-point in arbitrary-precision with limited exponent:
dpm - Rational numbers:
qpm - Binary floating-point in arbitrary-precision with limited exponent:
gpm - Binary balls in arbitrary-precision and with arbitrary exponent:
apm
- Mathematical functions in fixed precision (C#, can be called from Python)
- C# based context groups
- Scalar functions with
DoubleandComplex:math53andcmath53 - Binary floating point, single precision:
srealandscplx - Binary floating point, double precision:
drealanddcplx - Binary floating point, extended precision:
erealandecplx - Binary floating point, quadruple precision:
qrealandqcplx - Binary floating point, octuple precision:
orealandocplx - Building the underlying C#, C/C++ and Pascal libraries
- Mathematical functions based on XlCalcNet2 (C#, can be called from Python)
- Binary floating point, multiple precision:
mreal,mcplx - Binary arbitrary precision ball:
aflintandaflintc - Binary floating point, single precision:
sflintandsflintc - Binary floating point, double precision:
dflintanddflintc - Binary floating point, extended precision:
eflintandeflintc - Binary floating point, quadruple precision:
qflintandqflintc - Binary floating point, octuple precision:
oflintandoflintc - Binary floating point, multiple precision:
mflint,mflintc - Building the underlying C# and C/C++ libraries
- Binary floating point, multiple precision:
- A quick look at Numpy
- A quick look at Matplotlib and related libraries
- A quick look at Pandas and Xlxswriter
- Reading dataframes from
*.xlsxfiles - Writing a dataframe object to an
*.xlsxfile - Reading a dataframe from a
*.csvfile - Writing a dataframe to a
*.csvfile - Transforming data in a dataframe
- Xlsxwriter: creating files in the
*.xlsxformat - Python-docx: creating files in the
*.docxformat - Python-pptx: creating files in the
*.pptxformat
- Reading dataframes from
- A quick look at Scipy
- A quick look at R, RStudio and Rpy2