swcarpentry / python-novice-inflammation

Programming with Python
http://swcarpentry.github.io/python-novice-inflammation/
Other
302 stars 780 forks source link

Improving episode #1 #543

Open maxim-belkin opened 6 years ago

maxim-belkin commented 6 years ago

Our first episode 01-numpy.md is overloaded. I suggest discussing possible ways for reorganizing the lesson so that we don't have to talk about slicing numpy arrays and grouping matplotlib's plots in it.

My suggestion:

  1. Variables
  2. Types of data
  3. Inspecting data in variables using the builtin "print" function
  4. Loading data into Python as numpy array (import 1 data file with numpy.loadtxt)
  5. Visualize with Matplotlib

5 minutes on each topic = 25 minutes. Add time for exercises = 30 minutes (at least).

The rest of the current lesson can be moved to a new episode after the 6th episode on functions.

Thoughts? ideas?

annefou commented 6 years ago

I agree with you. We have far too much in this lesson and it is far too long to teach. I definitely agree to move everything related to slicing to another episode.

ldko commented 6 years ago

I like the idea of removing slicing and grouping plots from the first lesson to shorten it and make it less intense for beginners. I think it would still have a strong impact with doing visualizations on just one data file and save from all the heavy typing required to group the three plots into one figure at the end in just the first episode. Also, currently the part of the episode about performing arithmetic on arrays (doubledata and tripledata part) seems superfluous and further bogging down the first lesson.

maxim-belkin commented 6 years ago

yes, double/triple stuff is not necessary in the beginning.

caseyyoungflesh commented 6 years ago

I agree with this and would add that visualization could also be made its own lesson, as it is a somewhat distinct set of material.

caseyyoungflesh commented 6 years ago

Additionally, I think the exercises should be embedded in the lesson (e.g., a bit of lesson, a few exercises, a bit of lesson, a few exercises, ...). I think learners need a bit of a 'break' from listening to the instructor code to challenge themselves and practice a bit. Currently, all exercises are located at the end of the (very) long lesson. [was going to create another issue about this, but thought it fit well here]

caseyyoungflesh commented 6 years ago

Issue #452 also relevant

go-bears commented 6 years ago

Maybe there should be a quick mention of the snakecase naming convention for the variable weightkg in episode 1 . if you're coming from another language or non-programming background, one wouldn't know that "" functions as a space for readability

maxim-belkin commented 6 years ago

I'm not sure we should mention things like "snakecase", but explain that underscores help improve readability.

katebar commented 5 years ago

I would swap the order of the first two items:

  1. Types of data
  2. Variables
  3. Inspecting data in variables using the builtin "print" function
  4. Loading data into Python as numpy array (import 1 data file with numpy.loadtxt)
  5. Visualize with Matplotlib

I think that data types are foundational to the rest of the lesson. The instructor can then introduce variable assignments, and finally backpedal to data types by introducing the print function.

In terms of items 4 and 5, I think it would be helpful to spend more time defining matrices. I tend to get confused when thinking about multi-dimensional arrays, so slowing down there might be useful. Further, we could take the opportunity to further explain why we use the NumPy library: in addition to the points already mentioned in the lesson, NumPy arrays are somewhat simpler to manage than Python lists of lists. I think that the first Matplotlib visualization (imshow) is really helpful in thinking about matrices. Even if the other visualizations are removed from this lesson, I would keep the imshow viz.

khraftwerx commented 1 year ago

It may be useful to change the order of how variables and data types are introduced. If we illustrate data types and follow that with the actions and operations that can be done with them, the introduction of variables might follow in a more logical way. The examples provided are meaningful, but similar to Mathematics, the idea of arithmetic is introduced first with values and later represented using variables.