How to use the xlwings.func function in xlwings

To help you get started, we’ve selected a few xlwings examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alpha-miner / Finance-Python / excel / pyfin.py View on Github external
@xw.func
@xw.ret(expand='table')
@xw.arg('strikes', np.array, dim=1)
@xw.arg('volatilites', np.array, dim=1)
def sabrCalibration(strikes,
                    volatilites,
                    forward,
                    expiryTime,
                    intialAlpha,
                    initialBeta,
                    initialNu,
                    initialRho,
                    isFixedAlpha=False,
                    isFixedBeta=False,
                    isFixedNu=False,
                    isFixedRho=False,
                    method='trf'):
github alpha-miner / Finance-Python / excel / pyfin.py View on Github external
@xw.func
def sviVolatility(strike, forward, expiry, a, b, sigma, rho, m):
    return svi(strike, forward, expiry, a, b, sigma, rho, m)
github xlwings / xlwings / examples / udf / udf.py View on Github external
@xw.func
@xw.arg('x', pd.DataFrame, index=False, header=False)
@xw.ret(index=False, header=False)
def CORREL2(x):
    """Like CORREL, but as array formula for more than 2 data sets"""
    return x.corr()
github pymedphys / pymedphys / packages / pymedphys_xlwings / src / pymedphys_xlwings / xlwings / mephysto.py View on Github external
@xw.func
@xw.arg("filepath")
@xw.arg("index")
@xw.ret(expand="table")
def mephysto(filepath, index):
    filepath_found = wildcard_file_resolution(filepath)

    (axis, reading, scan_curvetype, scan_depth) = load_single_item(
        filepath_found, int(index)
    )

    second_column_header = ["Reading"]

    if scan_curvetype == "PDD":
        first_column_header = ["Depth Profile", "Depth (mm)"]
        second_column_header = [None] + second_column_header
    elif scan_curvetype == "INPLANE_PROFILE":
github pymedphys / pymedphys / packages / pymedphys_xlwings / src / pymedphys_xlwings / xlwings / numpy.py View on Github external
@xw.func
@xw.arg("values", np.array, ndim=2)
@xw.arg("repeats")
@xw.ret(expand="table")
def nprepeat(values, repeats):
    return np.expand_dims(np.repeat(values, repeats), axis=1)