DEV Community

Purva Masurkar
Purva Masurkar

Posted on

Day 3 of 100 Days of ML Code: NumPy

"Success is not final, failure is not fatal: it is the courage to continue that counts." - Winston Churchill

On the third day of my #100daysofcode challenge, I learned NumPy (Numerical Python) a Python library that is used for scientific computing and data analysis. I referred various resources for this Baiscs of NumPy and NumPy in One hour by freeCodeCamp.

Introduction to NumPy

NumPy is the fundamental package for scientific computing with python. It contains many other things:

  • N-dimensional array object
  • Broadcasting Functions
  • Useful for linear algebra, Fourier transform and random number capabilities.

Broadcasting means when you do any operation on the array that operation will get implemented on each element of the array

Difference between numpy array and list

  • Data type in NumPy should be same whereas it can be different in lists
  • Faster to read less bytes of memory
  • Contiguous memory
  • No type checking when iterating through objects.

List is built in int-type so it consists of four different things it consists Size, Refernce count, Object Type, Object Value.
This makes NumPy faster than Lists.

Importing and Creating NumPy array

Image description

Image description

Broadcasting and Creating matrix

Image description

Creating Random arrays

Image description

Image description

Array Concatenation

Image description

Image description

Accessing/ Changing specific elements, rows, columns

Image description

Image description


During my recent learning experience, I acquired knowledge on statistics, array manipulation such as reorganizing and stacking, as well as loading data from files. Additionally, I attended a Women Coders Meetup where I gained valuable insights, expanded my knowledge, and networked with individuals who share my interests. As a result, I took a break from my studies to attend this event.
I will continue listing my daily progress and try to remain consistent. Please do share your feedback on how I can my 100daysofcode challenge more productive. I'll see you tomorrow for my daily update.

  • Follow me on Twitter: @purvamasurkar12
  • Follow me on LinkedIn: @purvamasurkar12

Top comments (0)