numpy.asarray()This function is used to create an array by using the existing data in the form of lists, or tuples. This function is useful in the scenario where we need to convert a python sequence into the numpy array object. SyntaxParametersIt accepts the following parameters.
ReturnAn array with the equivalent values to the sequence is returned. ExampleOutput:
Example: Creating a numpy array from the TupleOutput:
Example: creating a numpy array using more than one listOutput:
Next Topicnumpy.frombuffer() |