-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: tuple indices must be integers or slices, not str #2
Comments
Hi, If you provide me a list of your files (I don't need data, just their names) and a complete python code, then I can for sure help more. In the meantime either make sure your files have such name or you can change the funtion |
Hi, Thank you so much for your response. Yes, it looks really good! The file name has the following format: The following is my code which is running in a Jupyter notebook:
I think we have the same naming convention so I shouldn't have to edit the code. |
If the error is still their maybe I need to know at what line the problem occurs. Could you post the full error? |
|
Can you try to execute the following for me? read = Matrix('/Users/sulaymandesai/Documents/Load data/09-Jun-2017')
print(read.images["default_2017Jun09-162147_STM-STM_Spectroscopy--4_5.I(V)_mtrx"]) |
ah yes and one very important question. Which version of python are you running and on which platform? |
I tried read.images[2] and returned a key error as well.
I am using Python 3.8.3 on a macOS operating system. I am using jupyter notebook to run my code. |
Ah you are doing I(Z) spectroscopy. This script uses I(V) spectroscopy. Try to change the I = u"%s--%i_%i.%s(Z)_mtrx"%(self.IDs[ID]['root'], ID, num, ext) and line 130 to I = u"%s--%i_%i.%s(Z)_mtrx"%(self.IDs[ID]['root'], ID, num, ext) does it help? |
Doesn't change anything. Still returns the same error |
Hi, |
Hi, No worries. I found another solution which better suited my needs. Many thanks, |
Wanna share a link to the other solution? Maybe other users would be interested... |
Great idea! |
Hi,
Below is my code.
I get the type error:
TypeError: tuple indices must be integers or slices, not str
Could you offer some assistance?
The text was updated successfully, but these errors were encountered: