question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: 'float' object is not subscriptable

See original GitHub issue

Greetings.

Here are the codes:

prot1 = u.atoms.select_atoms("resid 11")
prot2 = u.atoms.select_atoms("protein")

fp = plf.Fingerprint(['HBDonor', 'HBAcceptor', 'PiStacking', 'Anionic', 'Cationic', 'CationPi', 'PiCation'])
fp.run(u.trajectory[:2], prot1, prot2)
print(fp.ifp)
df = fp.to_dataframe(dtype=np.uint8)
print(df)
+ The outputs look good:

image

However, if I just change fp.run(u.trajectory[:2], prot1, prot2) to fp.run(u.trajectory[:3], prot1, prot2),

- the programm will raise an error::

image

Thanks for your attention.

pineapple

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
pineappleKcommented, Apr 3, 2021

😃 Thanks, it works but with a little error.

- fp.run(u.trajectory[i], lig, prot, progress=False)
+ fp.run(u.trajectory[i: (i+1)], lig, prot, progress=False)

or it will give you an error:

AttributeError: 'numpy.ndarray' object has no attribute 'frame'

Best wishes,

pineapple 🍍

1reaction
cbouycommented, Apr 2, 2021

Mmh it’s strange I just reinstalled it without any problem on my side.

Are you installing in a clean conda environment ? What version of python and pip are you using ? Also, can you try this:

pip install -U pip setuptools
conda update -c conda-forge ca-certificates

And then uninstall prolif and reinstall ?

Thanks, Cedric

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python typeerror: 'float' object is not subscriptable Solution
The “typeerror: 'float' object is not subscriptable” error occurs when you try to access items from a floating point number as if the...
Read more >
TypeError: 'float' object is not subscriptable - Stack Overflow
I get the same error : TypeError: 'float' object is not subscriptable in this line: print("%s: %.2f%%" % (model.metrics_names[0], scores[0]*100)) ...
Read more >
(Solved) Python TypeError: 'float' object is not subscriptable
The error message “ TypeError: 'float' object is not subscriptable ” happens if you access a float f like a list such as...
Read more >
TypeError: 'float' object is not subscriptable in Python
The Python "TypeError: 'float' object is not subscriptable" occurs when we try to use square brackets to access a float at a specific...
Read more >
TypeError: 'float' object is not subscriptable - openrouteservice
The output of the routes shows that distance is basically a float number and not a list. ... Hey,. this is a problem...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found