Before we get into what memory views are, we need to first understand about Python's Buffer Protocol.
What is a Buffer Protocol?
Simply said, buffer protocol provides a way to access the internal data of an object. This internal data is a memory array or a buffer.
Buffer protocol allows one object to expose its internal data (buffers) and the other to access those buffers without intermediate copying.
This protocol is only accessible to us at the C-API level and not using our normal code base.
So, in order to expose the same protocol to normal Python code base, memory views are present.
What is a memory view?
Memory view is a safe way to expose the buffer protocol in Python.
It allows you to access the internal buffers of an object by creating a memory view object.
The memoryview() method returns a memory view object of the given argument.