DataScience Classroomnotes 29/Jun/2022

Quick Refresher

Numpy

  • This is a python library used for working with arrays
  • Numpy arrays are upto 50x faster than traditional lists
  • The array object in the Numpy is called ndarray
  • In Numpy array all the items should be of same type, In datascience and machine learning, we would use numeric datatypes
  • In anaconda, numpy is pre-installed whereas in other python distributions pip install numpy
  • Using Numpy:
    Preview
  • The type of the array is numpy.ndarray which refers to ndimensional array
  • The most widely used convention
    Preview
  • Dimension: This is level or array depth
    Preview
  • Accessing array elements
    Preview
    Preview
  • Slicing Arrays:
    Preview
  • Data types in Numpy:
    • i: integer
    • b: boolean
    • u: unsigned integer
    • f: float
    • c: complex float
    • m: timedelta
    • M: datetime
    • O: object
    • S: string
    • U: unicode string
      Preview
  • Type conversions
    Preview
    Preview
  • Copy and view in numpy
    Preview
  • Shape of array: The shape of array is number of elements in each dimension
    Preview
  • Reshape arrays
    Preview
  • Refer Here for the jupyter notebook

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About continuous learner

devops & cloud enthusiastic learner