Created
October 12, 2011 00:44
-
-
Save koverholt/1279901 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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