# How to save a NumPy array to a text file in Python # Program to save a NumPy array to a text file# Importing required librariesimport numpy# Creating an arrayList = [1, 2, 3, 4, 5]Array = numpy.array(List)# Displaying the arrayprint('Array:\n', Array)file = open("file1.txt", "w+")# Saving the array in a text filecontent = str(Array)file.write(content)file.close()# Displaying the contents of the text filefile = open("file1.txt", "r")content = file.read()print("\nContent in file1.txt:\n", content)file.close()