Upload Excel or CSV file in google drive and connect from Colab Python platform using mount drive
ฝัง
- เผยแพร่เมื่อ 2 ต.ค. 2021
- Google colab platform we can use to read data from Excel or csv or from SQLite database file. We can place our files in google drive and use google mount to connect to these drives.
We will read data from one excel file and create a Pandas DataFrame.
Google colab uses Jupiter Notebook which we can create and same in our google drive. With this combination our entire database handling or file managing can be operated from google cloud platform.
To connect to google drive here is the code.
from google.colab import drive
drive.mount('/content/drive')
By using read_excel() we can connect to excel file and read the content of the file to create a dataframe.
Similarly we can read CSV file data and display the same.
#jupiterNotebook #Colab #ColabToDrive #PythonToDrive #Pandas #dataframe #ColabToDrive #googledrive #plus2net #python - วิทยาศาสตร์และเทคโนโลยี
Thanku❤
Thanks a ton, man
it's working
Glad to know that, thanks
thank you soo much sir.
So nice of you
Really helpful thank you very much for the help
Thanks, glad to know that
Thank you sir
Hello, when I use the command drive.mount to log in the drive account, there's no code, but instead of, it shows a message saying "Mounted at /content/gdrive"
Once you run the code , you will get a link to visit and collect the authorization code. Visit the link and you must login to our google account to get the code.
Yes that’s rights
If the pop up window doesn’t appear that means it’s mounted in the background
when i save my .csv file in drive and when i open it on my google colab it is coming as .gsheet extension can u please help me out
I uploaded one csv file to drive it came as csv only. For csv file to work with google colab , you have to mount it first.
Here is one some time back I worked.
th-cam.com/video/4u59d9np7Rk/w-d-xo.html
You can get all details here.
www.plus2net.com/python/colab.php
Can i make it update every time there is a change in the database?
Yes, even you can use SQLite ( file based database ) at google drive and from colab platform connect and manage it.
Using google drive API google sheets can be managed also. More details available here.
www.plus2net.com/python/pygsheets.php
Database can be kept in Cloud and operate the same from local platform also.
i created the exact path for excel file but after run the file, it's showing 'the path is not defined'.can you help me?
I hope it worked for you.
How to count how many female and male in excel file in google colab
There are many ways, one is read the excel file and create a Pandas dataframe and then all data we can generate.
Or directly from python you can rad google sheet.
www.plus2net.com/python/pygsheets.php
There are many functions like countunique() to get the numbers
Let us know which one you are using so I can tell you exact function to use