cell_UA3P_data = ['C41', 'C42', 'C45', 'C46', 'C47', 'C48', 'C49', 'C50', 'C51', 'C52', 'D41', 'D42', 'D45', 'D46', 'D47', 'D48', 'D49', 'D50', 'D51', 'D52', 'E41', 'E42', 'E45', 'E46', 'E47', 'E48', 'E49', 'E50', 'E51', 'E52', 'K41', 'K42', 'K45', 'K46', 'K47', 'K48', 'K49', 'K50', 'K51', 'K52', 'U41', 'U42', 'U45', 'U46', 'U47', 'U48', 'U49', 'U50', 'U51', 'U52', 'V41', 'V42', 'V45', 'V46', 'V47', 'V48', 'V49', 'V50', 'V51', 'V52', 'W41', 'W42', 'W45', 'W46', 'W47', 'W48', 'W49', 'W50', 'W51', 'W52', 'AC41', 'AC42', 'AC45', 'AC46', 'AC47', 'AC48', 'AC49', 'AC50', 'AC51', 'AC52']转换成10列的矩阵并转置,再将转置后的矩阵变为新的list
时间: 2023-08-16 12:09:42 浏览: 338
好的,以下是示例代码:
```python
import numpy as np
cell_UA3P_data = ['C41', 'C42', 'C45', 'C46', 'C47', 'C48', 'C49', 'C50', 'C51', 'C52', 'D41', 'D42', 'D45', 'D46', 'D47', 'D48', 'D49', 'D50', 'D51', 'D52', 'E41', 'E42', 'E45', 'E46', 'E47', 'E48', 'E49', 'E50', 'E51', 'E52', 'K41', 'K42', 'K45', 'K46', 'K47', 'K48', 'K49', 'K50', 'K51', 'K52', 'U41', 'U42', 'U45', 'U46', 'U47', 'U48', 'U49', 'U50', 'U51', 'U52', 'V41', 'V42', 'V45', 'V46', 'V47', 'V48', 'V49', 'V50', 'V51', 'V52', 'W41', 'W42', 'W45', 'W46', 'W47', 'W48', 'W49', 'W50', 'W51', 'W52', 'AC41', 'AC42', 'AC45', 'AC46', 'AC47', 'AC48', 'AC49', 'AC50', 'AC51', 'AC52']
matrix = np.array(cell_UA3P_data).reshape((-1,10))
transpose_matrix = matrix.T
new_list = transpose_matrix.tolist()
print(new_list)
```
输出结果为:
```
[['C41', 'D41', 'E41', 'K41', 'U41', 'V41', 'W41', 'AC41'], ['C42', 'D42', 'E42', 'K42', 'U42', 'V42', 'W42', 'AC42'], ['C45', 'D45', 'E45', 'K45', 'U45', 'V45', 'W45', 'AC45'], ['C46', 'D46', 'E46', 'K46', 'U46', 'V46', 'W46', 'AC46'], ['C47', 'D47',... 'W48', 'AC48'], ['C49', 'D49', 'E49', 'K49', 'U49', 'V49', 'W49', 'AC49'], ['C50', 'D50', 'E50', 'K50', 'U50', 'V50', 'W50', 'AC50'], ['C51', 'D51', 'E51', 'K51', 'U51', 'V51', 'W51', 'AC51'], ['C52', 'D52', 'E52', 'K52', 'U52', 'V52', 'W52', 'AC52']]
```
这样您就得到了您想要的10行的list。希望对您有所帮助!
阅读全文