### Categories

### RSS Feed

### Search NewtonExcelBach

### Archives

### Top Posts

- Using LINEST for non-linear curve fitting
- Using Goal Seek on Multiple Cells
- Cubic Splines
- Commenting a block of code in VBA
- Fitting high order polynomials
- Solving Quadratic, Cubic, Quartic and higher order equations; examples
- Using Linest for non-linear curve fitting, examples, hints and warnings
- The angle between two vectors, Python version
- Drawing in Excel 7 - Creating drawings from coordinates
- Writing Arrays to the worksheet - VBA function

### Recent Comments

dougaj4 on RCInteract and RC Design Funct… Stephen on RCInteract and RC Design Funct… dougaj4 on Solving Quadratic, Cubic, Quar… dougaj4 on RCInteract and RC Design Funct… Stephen on RCInteract and RC Design Funct… Paridhi Agarwal on Solving Quadratic, Cubic, Quar… dougaj4 on Raw Impact in Cambodia –… dougaj4 on Composite Beam Spreadsheet… Composite Beam Sprea… on Stress increments in prestress… Composite Beam Sprea… on Composite Beam Spreadsheet… dougaj4 on Composite Beam Spreadsheet… Stephen on Composite Beam Spreadsheet… dougaj4 on Composite Beam Spreadsheet… Stephen on Composite Beam Spreadsheet… dougaj4 on Tables and VBA

# Category Archives: NumPy and SciPy

## Using Alglib least-squares solvers

Following the last post on using the Python version of Alglib from Excel, via xlwings, this post looks in more detail at alternatives for fitting a non-linear function to a set of data, using the Levenberg-Marquardt method. The spreadsheet with … Continue reading

Posted in AlgLib, Curve fitting, Excel, Link to Python, Maths, Newton, NumPy and SciPy, UDFs, VBA, xlwings
Tagged AlgLib, Excel, Levenberg Marquardt, lsfit, minlm, Numpy, Python, SciPy, UDF, VBA, xlwings
Leave a comment

## Evaluating text and calling Python functions from Excel with xlwings

The Alglib spreadsheet presented here includes functions to evaluate formulas entered as text on the spreadsheet, or to call specified Python functions. I have now added a user defined function (UDF) that will perform either of these operations (xl_CallFuncD), and added … Continue reading

Posted in AlgLib, Excel, Link to Python, Maths, Newton, NumPy and SciPy, UDFs, VBA, xlwings
Tagged AlgLib, call Python functions, evaluate text strings, Excel, Numpy, Python, SciPy, UDF, VBA, xlwings
1 Comment

## Using Matplotlib from Excel with xlwings – update

In February 2016 I posted a spreadsheet with examples of linking to the Python Matplotlib library with xlwings. Since then updates to xlwings required some changes to the python code, specifically plot.show has been replaced with pictures.add. The spreadsheet has … Continue reading

Posted in Charts, Charts, Excel, Link to Python, Newton, NumPy and SciPy, VBA
Tagged Excel, MatPlotlib, Python, update, VBA, xlMatPlot, xlwings, xlwScipy
Leave a comment

## Indexing NumPy arrays with floats …

… now you can’t. I recently updated to the latest version of NumPy (1.12.1), and today I discovered that some of my spreadsheets using NumPy arrays (via xlwings) were returning errors like: IndexError: only integers, slices (`:`), ellipsis (`…`), numpy.newaxis … Continue reading

Posted in Arrays, Excel, Link to Python, NumPy and SciPy, UDFs, VBA
Tagged Float index, IndexError, Numpy, Python, VBA, xlwings
Leave a comment

## The meaning of = in Python

In VBA, if you have an array named a and a variant named b, then the statement “b = a” creates a new array b with the same size and values as a. If the values of either a or b are subsequently changed, the values of the … Continue reading

## Weighted Least Squares Regression, using Excel, VBA, Alglib and Python

Least squares linear regression in Excel is easy. That’s what the Linest and Trend functions do. That is, they find the coefficients of a straight line (or higher dimension shape) so that the sum of the squares of the distances of … Continue reading

Posted in AlgLib, Curve fitting, Excel, Link to Python, Maths, Newton, NumPy and SciPy, UDFs, VBA
Tagged AlgLib, Linest, Python, SciPy, UDF, VBA, Weighted least squares regression
3 Comments

## Transferring and converting strings in Excel and Python

The load table for the 3D Frame spreadsheet has a column listing the global axis for each load as text (X, Y, or Z). In the VBA version the table is converted to a variant array, and the axes are handled … Continue reading

Posted in Excel, Link to Python, Newton, NumPy and SciPy, VBA
Tagged Excel, map, Numpy, ord, Python, String functions, upper, VBA, xlwings
Leave a comment