Skip to content

Instantly share code, notes, and snippets.

@jkgiesler
Last active October 28, 2020 21:54
Show Gist options
  • Save jkgiesler/fe574a7d41aa894db55e to your computer and use it in GitHub Desktop.
Save jkgiesler/fe574a7d41aa894db55e to your computer and use it in GitHub Desktop.
from __future__ import print_function
import numpy as np
from xlwings import Workbook, Range
#Deep excel not included please find it here: http://www.deepexcel.net/
def run_test_data():
with open('test.csv','rt') as f:
with open('result.csv','wt') as r:
headers = f.readline()
for line in f:
data = line.strip()
row = data.split(',')
mat = np.reshape(row,(28,28))
wb = Workbook.caller()
Range('input','A1:AB28').value = mat
fit = Range('input','B31:K31').value
fit = [str(i) for i in fit]
print(','.join(fit),file = r)
Sub MyMacro()
RunPython ("import test;test.run_test_data()")
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment