Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
zeros() python function is undefined
zeros() python function is undefined
When I run my code zeros ([7,7], int) I get the error that the zeros() is undefined even though I have the numpy package installed. What gives?
Re: zeros() python function is undefined
Did you remember to import the proper package/library/whatever?
Re: zeros() python function is undefined
Yeah my code starts with
I don't get any errors on that line yet zeros(anything) throws an error everytime.
Code: Select all
import string, sys, random, array, Numeric, numpy
Re: zeros() python function is undefined
Hello All,
I am newbie to python. And i'm practicing at home to see the youtube videos.
I was trying to use a=zeros(5) in python, but getting the error. Please check it and help me to solve
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'zeros' is not defined
Please help me with this or suggest me any of the python tutorial where i can learn the deep concept of python.
Thanks in advance!
I am newbie to python. And i'm practicing at home to see the youtube videos.
I was trying to use a=zeros(5) in python, but getting the error. Please check it and help me to solve
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'zeros' is not defined
Please help me with this or suggest me any of the python tutorial where i can learn the deep concept of python.
Thanks in advance!
- GarryRicketson
- Posts: 5644
- Joined: 2015-01-20 22:16
- Location: Durango, Mexico
Re: zeros() python function is undefined
You can try to check it like this:Please check it and help me to solve
Python function undefined NameError: name 'zeros' is not defined
The first hit, is almost identical to what you posted, maybe it was you or you copied / pasted the same to here ???
https://bytes.com/topic/python/answers/ ... ot-defined
Says you need to use "numpy",
In the same results, there is this.Please help me with this or suggest me any of the python tutorial where i can learn the deep concept of python
https://docs.python.org/3.3/tutorial/introduction.html
Please make some effort to learn how to help your self, I will give you 1 more example, to help you get started.
python tutorial where i can learn the deep concept of python
You should see there are many results, there are many good tutorials, if for some reason you can not do searches on your own, or don't get any good results, maybe I will post some of the links here,..also, do you realize this thread is 10 years old ? No matter, now it will be more up to date.
The first hit, looks pretty good: https://docs.python-guide.org/intro/learning/
If you don't like that one, try some of the others, and please, in the future try to make a little effort to search for answers, and tutorials, learn how to help your self.
Maybe read this:
"What we expect you have already Done"