Python 2.7.3 or 3.4.1? Which to Learn for Physics/Math

  • Context: Python 
  • Thread starter Thread starter Cake
  • Start date Start date
  • Tags Tags
    Python
Click For Summary

Discussion Overview

The discussion revolves around the choice between learning Python 2.7.3 and Python 3.4.1 for programming in physics and mathematics. Participants explore the implications of version compatibility, library availability, and the learning process associated with each version.

Discussion Character

  • Debate/contested
  • Technical explanation
  • Conceptual clarification

Main Points Raised

  • One participant mentions using a book that teaches Python with a focus on Python 3, while also noting that codecademy teaches Python 2.7.3 due to compatibility issues with Python 3.
  • Another participant suggests that learning Python 2.7.3 would make transitioning to Python 3.4 easier.
  • It is proposed that either version would suffice for learning the basics of coding, as both versions operate similarly at a fundamental level.
  • A participant notes that while many scientific modules have not yet transitioned to Python 3, users can check the compatibility of specific libraries they need.
  • One participant expresses a preference for Python 2.7 due to the greater availability of useful libraries, citing personal experience with having to revert from Python 3.4.2 to 2.7 for library support.
  • Another participant states that if compatibility with libraries is a concern, Python 2.x should be used, otherwise Python 3.x is preferable.

Areas of Agreement / Disagreement

Participants express differing opinions on which version of Python to learn, with some advocating for Python 2.7.3 due to library support, while others suggest that either version is acceptable for learning purposes. The discussion remains unresolved regarding a definitive recommendation.

Contextual Notes

Participants highlight the importance of library compatibility and the learning curve associated with transitioning between Python versions. There is an acknowledgment of the ongoing changes in the Python ecosystem, particularly regarding scientific libraries.

Cake
Messages
100
Reaction score
16
I have a book for learning python that teaches it with python3 in mind. I also have been using codecademy.com to learn in a more structured way. The thing is that codecademy teaches python from when the most recent form of python was 2.7.3. Their reasoning behind this is that python3 isn't very backwards compatible so they're teaching 2.7.3 for now. If you were learning python for physics and mathematics programming, which version would you learn?
 
Technology news on Phys.org
Either way you'll be fine. The main purpose of initially learning how to code is to learn how python works. At the most basic level, python 2.7 and python 3 will work the same. If you want to be extra clever, you can follow the python 2.7 lessons and do it python 3. Thus teaching yourself the difference. However, as someone who knew python 2.7, teaching myself python 3 took a day at basic principles. A bit longer to get used to smaller modules, but the built in STAT modulo was nice.
 
Yes, for a long time now, everybody keeps talking of waiting for the move until all scientific modules have been ported over to 3...but you don't need them all, just check to see which ones you need and if those have already been ported over or not.

Lately, I learned of the Anaconda Python distribution...I liked it and install it; from the documentation, one can tell that it is fairly easy to switch between running 2.7 and 3.4 using conda.
 
I would learn 2.7 just because there are a lot more useful libraries for it so far. I don't know how many times I started writing a program in 3.4.2 and then I had to convert the whole thing back to 2.7 just because there weren't any libraries to do what I wanted. Unless you are either going to be using really standard libraries without getting too technical, or you are up to writing whole new libraries for 3.4.2 (which you aren't since you are just starting out), I would recommend 2.7.
 
If you need 2.x for compatibility with libraries, use that. Otherwise use 3.x.
 

Similar threads

  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 9 ·
Replies
9
Views
13K
  • · Replies 397 ·
14
Replies
397
Views
22K
  • · Replies 17 ·
Replies
17
Views
5K
  • · Replies 20 ·
Replies
20
Views
4K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 6 ·
Replies
6
Views
13K
  • · Replies 6 ·
Replies
6
Views
4K