Motivation
Motivation¶
We have been studying physics for about 6 years each. During that time we were both exposed to programming in different ways. For us that exposure was quite abrupt, as we were introduced to programming without any prior knowledge and were told to produce results. While this cold approach can make you learn a lot in a short time, it comes at the cost of not understanding some basic principles of writing readable and modular code.
In addition to teaching some basics to make navigating and writing code easier we also want to show some ways to make plotting and calculations more seemless. We will mainly be using the following libraries:
Numpy
Scipy
Matplotlib
Pandas
Numpy and Pandas offer great functionalities to deal with large amounts of data. While numpy is more focused on arrays and matrices and makes calculations with those easy and quick, pandas is easier to navigate when needing to use labeled data and group a lot of different datapoints in table (called a dataframe in pandas).
Scipy offers a plethora of analysis tools from data fitting and signal processing to simply having a lot of physics constants ready for import. It can also solve differentials and integrals analytically. And with some extra latex syntax we can also have a visual representation of the equations being solved.
In addition to those we will go over how to define your own functions and use python in a way that isn’t overwhelming but augments your studies in physics. However, our main focus is to get you started on doing stuff in python. Which is why the first couple of sections on this page are going to be devoted to simple tips and tricks to get you going without any prerequisite knowledge.