How can I create an empty NumPy array in Python.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dukool sharma
    New Member
    • Dec 2018
    • 9

    How can I create an empty NumPy array in Python.

    Can you explain me different ways to create an empty NumPy array in Python.
  • bansalhimani
    New Member
    • Dec 2018
    • 5

    #2
    We’ll talk about two methods to create NumPy array-

    First method-
    >>> import numpy
    >>> numpy.array([])
    array([], dtype=float64)

    Second method-
    >>> numpy.empty(sha pe=(0,0))
    array([], shape=(0, 0), dtype=float64)
    Last edited by Rabbit; Mar 14 '19, 04:14 PM. Reason: external link removed per forum policy

    Comment

    Working...