TDA AttributeError - python

I am new to TDA tools in python and I was implementing a simple code to get familiar with these, but I got a strange error
import tadasets
from ripser import ripser
import persim
circle = tadasets.dsphere(d=1)
dgms = ripser(circle)
persim.plot_diagrams(dgms)
AttributeError: 'dict' object has no attribute 'astype'.
Actually I am working on Jupyter notebook with python version 3.8.3

Related

'module' object is not callable in python roboticstoolbox by Peter Corke

Good morning everybody, I'm currently using the python Roboticstoolbox written by Peter Corke but I have a problem when trying to make the noodlelike plot of my robotic arm. The same error appears when trying to run the provided example:
Example code
The error is the following:
pyplot = rtb.backends.PyPlot() # create a PyPlot backend
TypeError: 'module' object is not callable
How can I make it work?

Module object in callable in python - Atom.io as as Jupyter notebook

import random
for i in random(10):
x = random.random()
print(x)
TypeError: 'module' object is not callable
I am getting the following error when I am trying to run this program in the atom.io

Pyviz Panel Examples Returning Attribute Errors

Working through the Panel user guide - any example on this page (https://panel.pyviz.org/user_guide/Components.html) that uses .extend does not seem to be working and is returning
AttributeError: 'Tabs' object has no attribute 'extend'
And the gridspec example returns:
AttributeError: module 'panel' has no attribute 'GridSpec'
Currently using Panel 0.3.1
Ben
Panel is currently at 0.6 (https://anaconda.org/pyviz/panel), and 0.3.1 won't support any of the more recent additions. So you should definitely upgrade, at which point it should match the website. If you do want to run the old version, just use the examples included with the package, which will match what's available in that version.
Not sure this is a version issue: I am using v.0.6.2 and running the following example:
radio_group = pn.widgets.RadioButtonGroup(name='Radio Button Group',
options=['Biology', 'Chemistry', 'Physics'],
button_type='success')
radio_group
also yields the same kind of error:
AttributeError: 'RadioButtonGroup' object has no attribute 'value'

Python: Thermopy module "AttributeError: 'module' object has no attribute 'burcat'"

I've just had to try and teach myself python for a project at work and it isn't going so well.
I'm trying to use the module "Thermopy" so that I can make programs for calculating gas dynamics etc.
I thought I had installed Thermopy correctly but when I went to just have a quick test of it, I couldn't get it to work, it imports the module fine and help(thermopy) seems to show it importing the right file (I think?) but If I then try and call any of the classes that should be in the module I get the error AttributeError: 'module' object has no attribute 'psicrometry' (Or whichever class I'm trying to call
e.g.
import thermopy
help(thermopy)
print thermopy.__file__
thermopy.psicrometry.test_wark()
gives the result
Help on package thermopy:
NAME
thermopy
FILE
c:\python27\lib\site-packages\thermopy-0.3-py2.7.egg\thermopy\__init__.py
PACKAGE CONTENTS
burcat
codata
combustion
constants
iapws
psicrometry
units
DATA
__version__ = '0.3'
VERSION
0.3
C:\Python27\lib\site-packages\thermopy-0.3-py2.7.egg\thermopy\__init__.pyc
Traceback (most recent call last):
File "\\FGBD101000.wsatkins.com\GBBSB_Home$\BROW4631\My Documents\Python\thermopy testing", line 7, in <module>
thermopy.psicrometry.test_wark()
AttributeError: 'module' object has no attribute 'psicrometry'
Any help on this is greatly appreciated, I'm very new to all this and don't have any prior programming experience so apologies if I'm doing anything silly, but I couldn't understand any of the other answers I saw to similiar questions on the site.
Many thanks
James

Python Blender math.trunc()

iam trying to use the math.trunc in Blender 2.49b Python
but iam getting this error
AttributeError: 'module' object has no attribute 'trunc'
i also imported math
its on line
uv[i][0] = trunc(uv[i][0] * 100000) / 100000
i also tryied it via the int, like
uv[i][0] = int(uv[i][0] * 100000) / 100000
which gives me an error
TypeError: 'float' object is
unsubscriptable
so how should i trunc the value:(
thank you
The second error seems to imply that uv in your code is a float object and you are trying to subscript it uv[i]. Try to math.trunc(uv) and see. Also you can check if trunc is available by doing hasattr(math,'trunc')
It might depend what verson of Python is used by Blender (I imagine that would be Python 2.5).
Try this in Blender:
import math
help(math)
This will crash Blender, but you will be able to see the math to the library under FILE and you should be able to scroll down to see if the trunc function is available in the version of Python used by Blender. It might be not present, which would explain the error.

Categories

Resources