开发者

I want to use NumPy/SciPy. Should I use Python 2 or 3?

开发者 https://www.devze.com 2023-02-06 12:51 出处:网络
I am about to embark on some signal processing work using NumPy/SciPy. However, I have never used Python before and don\'t know where to start.

I am about to embark on some signal processing work using NumPy/SciPy. However, I have never used Python before and don't know where to start.

I see there are currently two branches of Python in this world: Version 2.x and 3.x. Being a neophile, I instinctively tend to go for the newer one, but there seems to be a lot of talk about incompatibilities between the two. Numpy seems to be compatible with Python 3. I can't find any documents on SciPy.

Would you recommend to go with Python 3 or 2?

(could you point me to some resources to get 开发者_StackOverflow中文版started? I know C/C++, Ruby, Matlab and some other stuff and basically want to use NumPy instead of Matlab.)


Both scipy and numpy are compatible with py3k. However, if you'll need to plot stuff: matplotlib is not yet officially compatible with py3k. So, it'll depend on whether your signalling processing involves plotting.

Syntactic differences are not that great between the two version.


I am using Python 2.6 with Numpy. I can confirm that Python 3 is not backward compatible. So I myself am not very confident with upgrading. Have a look at the cookbook to get started

http://www.scipy.org/Cookbook


I personally suggest you begin with 2.7, 'cause it seems to me that there is a lot of time before 2.x will become deprecated. read more hear http://docs.python.org/dev/whatsnew/2.7.html


@SilentGhost

Scipy for python 3.2 available in beta: http://sourceforge.net/projects/scipy/files/scipy/0.10.0b2/


I am quite conservative in this respect, and so I use Python 2.6. That's what comes pre-installed on my Linux box, and it is also the target version for the latest binary releases of SciPy.

Python 3 is without a doubt a huge step forward, but if you do mainly numerical stuff with NumPy and SciPy, I'd still go for Python 2.


I can recommend Using py3k over py2.6 if possible. Especially if you're a new user, since some of the syntax changes in py3k and it'll be harder to get used the new syntax if you're starting out learning the old.

The modules you mention all have support for py3k but as SilentGhost noted you might want to check for compatibility with plotting libraries too.

0

精彩评论

暂无评论...
验证码 换一张
取 消