Skip to content

Instantly share code, notes, and snippets.

@koverholt
Created October 12, 2011 00:44
Show Gist options
  • Save koverholt/1279901 to your computer and use it in GitHub Desktop.
Save koverholt/1279901 to your computer and use it in GitHub Desktop.
import numpy as np
def stats(path, string):
# Write to stats text file
filename = path
f = open(filename, 'a')
f.write(string)
f.close()
headers = np.array(['Name', 'Temperature (C)', 'Heat Flux (kw/m2)'])
values = np.array([[1,2,3],[4,5,6],[7,8,9]])
output = np.row_stack([headers, values])
output = output.tolist()
print output
for n in range(len(output)):
outstring = output[n] + ['\n']
stats('output.csv', ','.join(outstring))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment