Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problems with NumPy
#1
Hi there,
I'm trying to call a very simple numpy function:

import numpy as np
a=np.array([1,2,3,4,5])

I saved this file as .py and run the file through my cmd. But I have no results after this line:
C:\Users\DSule\Desktop\python>np_test.py

What's the problem?

Regards,
J
Reply
#2
use:
C:\Users\DSule\Desktop\python>python np_test.py
Reply
#3
still no results... :(
Reply
#4
Is
import numpy as np
a=np.array([1,2,3,4,5])
all your np_test.py contains? If so, then there can not be any output. Insert print(a) to print the array.
Reply
#5
Thanks it works!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [Numpy] How to store different data type in one numpy array? water 7 2,724 Mar-26-2024, 02:18 PM
Last Post: snippsat
  Numpy returns "TypeError: unsupported operand type(s) for *: 'numpy.ufunc' and 'int'" kalle 2 4,056 Jul-19-2022, 06:31 AM
Last Post: paul18fr
  "erlarge" a numpy-matrix to numpy-array PhysChem 2 3,830 Apr-09-2019, 04:54 PM
Last Post: PhysChem

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020