从列表中创建一个值数组的尺寸不同 我需要创建一个函数,该函数获取输入列表或numpy数组并创建为字符串。当了解数字和细节时,这个问题很容易计算。就像在

问题描述 投票:0回答:0

我喝了咖啡,找到了A解决方案。这将创建取决于x和y的值数组。

import numpy as np x = 5 y = 100 inputArray = np.zeros(x) squares = [list(inputArray+i) for i in range(y)] values = ','.join([f"{j}" for j in squares]) ```
    

python list numpy join
最新问题
© www.soinside.com 2019 - 2025. All rights reserved.