Skip to content

Instantly share code, notes, and snippets.

@Zlatkovsky
Created May 3, 2019 22:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Zlatkovsky/3890dae8bebb53658e04efbbb6f3f46d to your computer and use it in GitHub Desktop.
Save Zlatkovsky/3890dae8bebb53658e04efbbb6f3f46d to your computer and use it in GitHub Desktop.
A basic Custom Function, written in Python
name: CF Python Demo
description: 'A basic Custom Function, written in Python'
host: EXCEL
api_set: {}
script:
content: |-
import customfunctions as cf
@cf.customfunction("ADD")
def myadd(x, y):
return x + y
import statistics
@cf.customfunction("PYSTDEV",
parameters=[
cf.ParameterInfo(dimensionality=cf.Dimensionality.matrix)])
def pystdev(data):
flatList = [item for sublist in data for item in sublist]
return statistics.stdev(flatList)
language: python
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment