CST383: learning log 1
This week I learned more about NumPy and how it fits into Python for the data science class and concepts we're going to learn this semester. I learned that NumPy arrays are faster than regular Python lists because they store data in a more efficient way in memory and all the values are the same type. This made it clearer why vectorized operations are something I should probably look into more. Doing math on an entire array at once feels more efficient than writing loops, and I can see how this can make a huge impact when working with large datasets or machine learning later on.
One thing I’m still getting used to is indexing, especially fancy indexing and working with 2D arrays. I understand what slicing does on its own, but when combining slicing, fancy indexing, and rows vs columns, I have to slow down and think it through. Also from the homework, I realize that I need to pay more attention to the formatting, since I almost missed the single vs. double square brackets in the assignment! Boolean masking made more sense to me this week. It feels like a really useful way to filter data without writing a bunch of if statements, and it seems much more readable once you understand what the mask represents.
I also started thinking more about why NumPy is so much faster. We hear that it’s way faster than normal Python lists, but it made me curious about when that actually matters. For small problems, I wonder if the difference is noticeable at all. I’m also curious about what parts of NumPy are written in C and how that impacts performance. I learned more about NumPy than I ever did, especially with the inner workings of it rather than just the concept to solve problems. Looking forward to next week.
Comments
Post a Comment