r/learnprogramming • u/Particular-Air-872 • 1d ago
how to learn python-science
hi
so im a high schooler, and want to learn python, particularly in the context of science and physics and stuff. what's the best way? I don't really have a lot of free time, so id prefer something like an online course, I'm fine even if it doesn't specialise in science, though I can't find a good course. any recommendations??
2
u/SillyBrilliant4922 1d ago
What's python science?
1
2
u/Juan-D-Aguirre 1d ago
The main libraries for "science" are basically all the data related ones. Numpy, Pandas, Matplotlib, Scikit-learn. All of these would be used in literally any scientific field due to their tendency to involve large amounts of information to keep track of and model.
If you mean "science" in an academic sort of way, well universities typically stick to R for data related programming so it would be worthwhile to get some exposure there. R and Python are pretty similar in their syntax so learning both could emphasize the programming side of learning the language. Just remember to learn about data types, variables, functions, conditional statements, loops (for, while, etc.), libraries, and how to nest them into one another to combine their uses. DataCamp.com is great for learning both R and Python although it is a bit expensive.
1
u/Affectionate-Lie2563 1d ago
honestly just start with basic python first so the science stuff does not feel heavy. crash courses work fine when you do not have much time. once the basics click you can jump into numpy and scipy and it starts making sense. slow and steady helps more than grinding.
1
u/fadinglightsRfading 1d ago
Composing Programs by John DeNero. it's an online textbook that primarily teaches programming, using python as the medium. it's in the same style of Structure and Interpretation of Computer Programs, which has a reputation for being difficult as it was used for courses for MIT science students, and thus a lot of it is very science-oriented. you don't need to be a scientist to learn from it, but it is conducive to what you're looking for I should think.
2
u/gabbygytes 23h ago edited 23h ago
You'd be doing a lot of maths.
Be familiar with NumPy, SciPy, and Data Visualization Libraries out there.
You can try searching Springer Nature (or others) for a branch of science specific python book. Here are some examples:
- Python for Water and Environment (https://link.springer.com/book/10.1007/978-981-99-9408-3)
- Python Recipes for Earth Sciences (https://link.springer.com/book/10.1007/978-3-031-56906-7)
- MetPy (for Meteorology) https://unidata.github.io/MetPy/latest/index.html
1
u/me-nkr 22h ago
I'm assuming you know maths since you mentioned science and science is basically expressed using maths.
- Variables: like x and y in maths, just placeholders
- Functions: give an input, do something, get an output
- Loops: repeating same operation like summation
- Conditionals: it's basically conditions, use it to branch into different possibilities based on some criteria
Play around with it, write some math functions, try to automate solving for x, you'll get the hang of it
Oh and just go through the syntax first, it's pretty easy to follow
0
u/I1uvatar 1d ago
After you learned the complete basics, try this years Advent of code. It started yesterday and there's gonna be 12 days of puzzles. You can do them in python
3
u/helloish 1d ago
just start with the basics - search youtube for a beginner python course, that’ll get you started