1. Import Drive
First we need import Drive in our Note Book, use this commands:
from google.colab import drive
2. Mount your Google Drive
Mount your Google Drive at the specified mount-point path.
drive.mount('/content/drive')
This command ask for permissions for use your Drive
3. Import Pandas
For load CSV in our Notebook, we use:
Import Pandas
import pandas as pd
4. Load CSV in Drive with Pandas
Read CSV file with Pandas
pd.read_csv('/content/drive/My Drive/{csv location}')
example
pd.read_csv('/content/drive/My Drive/Colab Notebooks')
If you CSV file has many pages, you can use this line
pd.read_excel('{csv_location}', sheetname='{sheetname}')
example
pd.read_excel('/content/drive/My Drive/Colab Notebooks', sheetname='january accounting')
If the columns in your CSV is separate with special character, you can use:
pd.read_csv('/content/drive/My Drive/{csv location}' , sep='{special_character}')
example
pd.read_csv('/content/drive/My Drive/Colab Notebooks' , sep='|')
Top comments (0)