DEV Community

Ramya .C
Ramya .C

Posted on

๐Ÿ“ŠNumPy Practice !

๐Ÿ”ข Building Strong Data Analytics Foundations ๐Ÿš€

Today I focused on improving my Python skills by practicing NumPy, one of the most powerful libraries used in Data Analytics and Machine Learning.
NumPy makes numerical operations faster, cleaner, and more efficientโ€”especially when working with large datasets.


๐Ÿ” What I Practiced

โœ”๏ธ Basic Array Operations

  • Creating arrays: array(), arange(), linspace()
  • Indexing & slicing (1D, 2D, 3D)
  • Mathematical & statistical operations
  • Broadcasting
  • Reshaping arrays with reshape()

โœ”๏ธ Intermediate Operations

  • Horizontal & vertical stacking
  • Boolean filtering
  • Using the random module:
  np.random.rand()
  np.random.randn()
  np.random.randint()
Enter fullscreen mode Exit fullscreen mode
  • Vectorization for fast computations

๐Ÿ”ฅ Additional Advanced Practice

๐Ÿ“Œ Matrix Multiplication

np.dot(a, b)
np.matmul(a, b)
Enter fullscreen mode Exit fullscreen mode

๐Ÿ“Œ Conditional Selection

np.where(condition, value_if_true, value_if_false)
Enter fullscreen mode Exit fullscreen mode

๐Ÿ“Œ Sorting & Unique Values

np.sort(arr)
np.unique(arr)
Enter fullscreen mode Exit fullscreen mode

๐Ÿ“Œ Loading CSV Files

np.genfromtxt("data.csv", delimiter=",")
Enter fullscreen mode Exit fullscreen mode

๐Ÿ“Œ Performance Practice

  • Compared memory usage of Python lists vs NumPy arrays
  • Used %timeit in Jupyter Notebook for speed comparison

๐Ÿง  Why NumPy Matters in Data Analytics?

  • Extremely fast numerical operations
  • Clean, simple, and vectorized code
  • Foundation for Pandas, Matplotlib, Scikit-Learn
  • Widely used in data preprocessing and ML models

๐Ÿ”— GitHub Repository

You can check my NumPy practice code here:
๐Ÿ‘‰ GitHub: https://github.com/ramyacse21/numpy_workspace

Top comments (0)