Javatpoint Logo
Javatpoint Logo

numpy.frombuffer()

This function is used to create an array by using the specified buffer.

Syntax

Parameters

It accepts the following parameters.

  1. buffer: It represents an object that exposes a buffer interface.
  2. dtype: It represents the data type of the returned data type array. The default value is 0.
  3. count: It represents the length of the returned ndarray. The default value is -1.
  4. offset: It represents the starting position to read from. The default value is 0.

Return

The array version of the buffer is returned.

Example

Output:


[b'h' b'e' b'l' b'l' b'o' b' ' b'w' b'o' b'r' b'l' b'd']


Next Topicnumpy.fromiter()





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA