NumPy Tutorial: Your First Steps Into Data Science in Python

By realpython - 2021-02-25

Description

In this tutorial, you'll learn everything you need to know to get up and running with NumPy, Python's de facto standard for multidimensional data arrays. NumPy is the foundation for most data science ...

Summary

  • NumPy is a Python library that provides a simple yet powerful data structure: Because of the particular calculation in this example, it makes life easier to have integers in the numbers array.
  • 7averages=img.mean(axis=2)# Take the average of each R, G, and B 8mpimg.imsave("bad-gray.jpg",averages,cmap="gray") These new lines create a new array called averages, which is a copy of the img array that you’ve flattened along axis 2 by taking the average of all three channels.
  • Conclusion No matter how many dimensions your data lives in, NumPy gives you the tools to work with it.

 

Topics

  1. Backend (0.31)
  2. Database (0.2)
  3. Coding (0.17)

Similar Articles

Home

By fast - 2020-08-21

Making neural nets uncool again

Creating beautiful maps with Python

By Medium - 2021-01-31

I always liked city maps and a few weeks ago I decided to build my own artistic versions of it. After googling a little bit I discovered this incredible tutorial written by Frank Ceballos. It is a…

Python enumerate(): Simplify Looping With Counters

By realpython - 2020-12-15

Once you learn about for loops in Python, you know that using an index to access items in a sequence isn't very Pythonic. So what do you do when you need that index value? In this tutorial, you'll lea ...