I am using the notebooks instance within the AI platform in google cloud console. I have uploaded a folder inside which contains around 30 csv files.
I run the following code to iterate over the files,
for subdir, dirs, files in os.walk('~/uploadedfiles/'):
for file in files:
filepath = os.path.join(subdir, file)
print(filepath)
However, for some reason, I can seem to iterate over the files. The cell just ends with no errors. How do I fix this?
Try replacing the ~ with the full path. Python may not do the bash expansion on that tilde:
This worked with this dir structure:
like so:
But didn't work when I used the tilde.