What is the best book for learning python for physics applications?

In summary, the conversation is about someone looking for a book to self-learn Python for their physics degree. They want a book that focuses on the application of Python for physical simulations and solving equations. Some suggestions are given for learning the basics of programming and using the numpy/scipy library. Two books, "Computational Physics" by Mark Newman and "Learn Python the Hard Way" by Zed Shaw, are recommended for learning Python for physics.
  • #1
TheQQ
5
0
Hello,

I would like to self learn python for my physics degree, but I don't really have an idea where to start. Could anyone recommend a good book out there for beginners (zero experience with programming)?

I don't want anything too comprehensive; that's for comp sci majors. I'm really just looking for a book with a focus on the application of python for physical simulations, solving equations, etc.

thanks
 
Technology news on Phys.org
  • #2
I don't know of any books on the subject. If you have zero experience, you should start with learning to program. You can do stuff like code academy to learn the syntax (http://www.codecademy.com/, you won't learn how to code with these tutorials). Then you probably should work through some proper python tutorial or take a course on it if possible. When I was getting into python, I did this tutorial http://learnpythonthehardway.org/book/.
I didn't like it that much, but many people are saying it's great so you can look into it I guess. It requires you to learn basics of command line interface too.

When you know how to code, you can start looking into numpy/scipy library http://www.scipy.org/
It's probably the biggest and most widely used scientific library for python. For learning scipy you can google some material (like http://scipy-lectures.github.io/intro/index.html).

Then of course there are libraries like pygame which are nice for making little physics simulations/games (collisions, planetary systems) with some (2D) graphics.

But you really need to learn some programming first (not theory, just how to build a program), and the fastest way to learn that is writing programs.
 
  • Like
Likes 1 person
  • #5
Thanks for the suggestions,

The book by Langtangen looks fairly interesting with good reviews on amazon so I think I'll try to start with that.
 
  • #7
Last edited by a moderator:

1. What is Python and why is it useful for physics?

Python is a high-level, general-purpose programming language that is widely used in various fields, including physics. It is useful for physics because it has a simple and easy-to-learn syntax, a large standard library, and powerful scientific computing libraries such as NumPy and SciPy. It also allows for fast prototyping and visualization of data, making it a valuable tool for researchers and scientists.

2. What topics in physics can be covered in a book on Python?

A book on Python for physics can cover a wide range of topics, including classical mechanics, electromagnetism, quantum mechanics, statistical mechanics, and computational physics. It can also delve into specific applications such as data analysis, simulations, and machine learning for physics problems.

3. Do I need to have prior programming experience to understand a book on Python for physics?

While having some programming experience can be helpful, it is not necessary to understand a book on Python for physics. The book may start with basic concepts and gradually introduce more advanced topics, making it accessible to beginners. However, having a basic understanding of physics concepts is recommended.

4. Are there any resources or exercises included in the book?

Many books on Python for physics include exercises, problems, and projects for readers to apply their knowledge and reinforce their understanding. They may also include links to additional resources, such as online tutorials or code repositories, for further learning.

5. Can a book on Python for physics be helpful for both beginners and experienced programmers?

Yes, a book on Python for physics can be beneficial for both beginners and experienced programmers. Beginners can learn the basics of programming and how to apply them to physics problems, while experienced programmers can expand their knowledge and learn specific techniques for scientific computing in Python.

Similar threads

  • Programming and Computer Science
Replies
6
Views
2K
Replies
6
Views
651
  • Programming and Computer Science
Replies
7
Views
2K
  • Programming and Computer Science
Replies
3
Views
1K
  • Programming and Computer Science
Replies
4
Views
2K
  • Science and Math Textbooks
Replies
7
Views
657
  • Programming and Computer Science
Replies
9
Views
1K
  • Programming and Computer Science
Replies
1
Views
278
  • Programming and Computer Science
Replies
2
Views
1K
  • Programming and Computer Science
Replies
1
Views
728
Back
Top