save numpy array to text file
a_file = open("test.txt", "w")
for row in an_array:
np.savetxt(a_file, row)
a_file.close()
save numpy array to text file
a_file = open("test.txt", "w")
for row in an_array:
np.savetxt(a_file, row)
a_file.close()
Print array to a file
//Either var_export or set print_r to return the output instead of printing it.
$b = array (
'm' => 'monkey',
'foo' => 'bar',
'x' => array ('x', 'y', 'z'));
$results = print_r($b, true); // $results now contains output from print_r
//You can then save $results with file_put_contents. Or return it directly when writing to file:
file_put_contents('filename.txt', print_r($b, true));
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us