<jupyter_start><jupyter_text>[View in Colaboratory](https://colab.research.google.com/github/todun/googlecolab/blob/master/Upload_files_from_GDrive_to_GoogleColab.ipynb)  [Uploading and Using Data Files](https://stackoverflow.com/a/47335122)Get local files  from google drive to upload into Colab environment. Select file(s) using the following:<jupyter_code>from google.colab import files
uploaded = files.upload()<jupyter_output><empty_output><jupyter_text>Iterate uploaded files Use the following to iterate the uploaded files in order to find their key names, using:<jupyter_code>for fn in uploaded.keys():
  print('User uploaded file "{name}" with length {length} bytes'.format(name=fn, length=len(uploaded[fn])))<jupyter_output><empty_output><jupyter_text>[load the contents of the file](https://stackoverflow.com/a/49226782)An example of loading contents of file into a Pandas DataFrame is shown below:<jupyter_code>import pandas as pd
import io
df = pd.read_csv(io.StringIO(uploaded['iris.csv'].decode('utf-8')))
print(df)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11226415094339623, 'fraction_numerical': 0.016037735849056604, 'mean_word_length': 7.69672131147541, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '390784', 'license': 'MIT', 'n_tokens_mistral': 359, 'n_tokens_neox': 339, 'n_words': 84, 'path': 'Upload_files_from_GDrive_to_GoogleColab.ipynb', 'repo_name': 'todun/googlecolab', 'size': '1060'}