Write a NumPy program to save as text a matrix which has in each row 2 float and 1 string at the end
- برمجة بايثون
- 2021-09-13
- mhanasmh00489829403
الأجوبة
import numpy as np
matrix = [[1, 0, 'aaa'], [0, 1, 'bbb'], [0, 1, 'ccc']]
np.savetxt('test', matrix, delimiter=' ', header='string', comments='', fmt='%s')
Sample Output:
string 1 0 aaa 0 1 bbb 0 1 ccc
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال