The following code on apache zeppelin (version 0.6.1)
%python
import pandas as pd
del(listResult)
listResult = list(collection.distinct("species",{"yr": yrs,"species":{"$ne":""}}))
df = pd.DataFrame(listResult,columns=['Species sighted and/or captured this year'])
z.show(df)
only works at the first time i click "run all paragraphs".
After that, if i run the paragraph, the following error appears:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 27, in show
File "<stdin>", line 32, in show_dataframe
TypeError: 'list' object is not callable
It only works againd when i restart python interpreter. Can you help me understand what's happening?
Thanks!
Related
I am learning to use ray on a cluster from the official documentation
I just wanted to test a single functionality which is ray.services.get_node_ip_address(), but I have the following error:
>>> import ray
>>> ray.services.get_node_ip_address()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'ray' has no attribute 'services'
It is in ray._private.services.get_node_ip_address()
It seems that the location of get_node_ip_address() is changed from ray.services.get_node_ip_address() to ray._private.services.get_node_ip_address()
I have an Epson thermal printer (TM-82), connected via USB. I am using python-escpos library (version v2.2.0) I am trying to run some of Escpos module's methods such has ln(), textln(), etc. But none of these commands work, and I get an error 'Usb' object has no attribute <method_name>. The only commands that work are text(), qrcode(), barcode(), image() and cut().
Can you guys please tell me what's wrong?
Steps to reproduce
>>> from escpos import printer
>>> p = printer.Usb(0x04b8, 0x0e11, 0)
>>> p.text('hello')
>>> p.ln()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'Usb' object has no attribute 'ln'
>>> p.is_online()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'Usb' object has no attribute 'is_online'
If you are using python-escpos 2.2.0, look at the source and documentation for that version.
There is no ln or is_online function in that version.
I receive python stack traces from logs and they sometimes come in very weird format, e.g. no new lines or incorrectly formated. Here is an syntactic example:
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<stdin>", line 2, in bar File "<stdin>", line 2, in foo ValueError
Unfortunately, there is no way I can change the format of the logs, as I don't have an access to that system.
Is there an automatic way of formatting those exceptions to standard python format, so that it would look something like this:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in bar
File "<stdin>", line 2, in foo
ValueError
I've quickly went through traceback module's documentation, but it seems it's only for runtime exceptions.
I'm using python v2.7.3 - Installed python-rq via easy_install. While trying to create RQ queue with steps given at http://python-rq.org/ . it fails with message like
>>> from redis import Redis
>>> from rq import Queue
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "rq.py", line 11, in <module>
q = Queue(connection=Redis())
TypeError: 'module' object is not callable
>>>
>>> q = Queue(connection=Redis())
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'Queue' is not defined
>>>
Whats the issue here and how to fix this?
Reposting comment as answer:
Thanks for the answer. Sorry stupid me! .sometime back I created file named rq.py and its creating problem. Deleted that file.solved the issue
I have checked that the file in my disk is the same as https://github.com/scipy/scipy/blob/master/scipy/misc/face.dat
but when I run this statement ,I have got this error. why ?
scipy.misc.face()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\scipy\misc\common.py", line 567, in face
data = bz2.decompress(rawdata)
ValueError: couldn't find end of stream
It's a bug (on Windows), see here
https://github.com/scipy/scipy/commit/7f0210fd28a2b3be79806d5cae462be52c1601e9