I uploaded a file in googl colab and I tried to get the name of the file
This is a result when I print upload.keys()
:
dict_keys(['SSE.csv', 'SSE_origin.csv'])
I tried to access each element of object. I only find this solution.
from google.colab import files
uploaded = files.upload()
for name in uploaded.keys():
print(name)
Is there any other solution like indexing?
The problem is that you have a dict_keys object, not a list. To use it as a list you have to convert it:
list(uploaded.keys())
Now you can access each element by indexing