Created
August 1, 2018 05:42
-
-
Save debaonline4u/dc21b4f7b03995f6f2d2db46120e422a to your computer and use it in GitHub Desktop.
create string type array using numpy array()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Python program to create a string type array using numpy array() method. | |
from numpy import * | |
arr = array(['Delhi', 'Mumbai', 'Hyderabad', 'Bengaluru', 'Bhubneswar', 'Baroda']) | |
# Creating an array from another array. | |
arr2 = array(arr) | |
arr3 = arr | |
# display the arrays: | |
print('arr = ', arr) | |
print('arr2 = ', arr2) | |
print('arr3 = ', arr3) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment