Python的 - 做一个数组:N为n [英] Python - Make an Array: n by n

查看:153
本文介绍了Python的 - 做一个数组:N为n的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


  

可能重复:结果
  如何定义在python

我有重新presents在一个文件中的许多文件,N个变量。我想打一个数组,其大小是'N'×'N'。然后我想只用0来填补它。是一个数组一样名单列表?你如何在Python的数组,你怎么让它'N'由'B'大吗?这可能是一个很初级的问题,但我是新来stackoverflow.com。


解决方案

我建议使用numpy的。

下面是对numpy的教程链接: http://www.scipy.org/Tentative_NumPy_Tutorial

我用numpy的很多关于各种数学函数和数据处理

Possible Duplicate:
How to define Two-dimensional array in python

I have a variable that represents the number files in a file, n. I want to make a array whose size is 'n' x 'n'. Then I want to fill it with just 0's. Is an array the same as a list of lists? How do you make an array in Python, and how do you make it 'n' by 'b' big? This is probably a very novice question, but I'm new to stackoverflow.com.

解决方案

I suggest using NumPy.

Here is a link to the NumPy tutorial: http://www.scipy.org/Tentative_NumPy_Tutorial

I use NumPy a lot for all sorts of mathematical functions and data manipulation

这篇关于Python的 - 做一个数组:N为n的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆