import pandas as pd
import gspread
from gspread_dataframe import set_with_dataframe
from oauth2client.service_account import ServiceAccountCredentials
from gspread_dataframe import get_as_dataframe, set_with_dataframe
d = {'col1': [1, 2], 'col2': [3, 4]}
df = pd.DataFrame(data=d)
scope = ['
https://spreadsheets.google.com/feeds', '
https://www.googleapis.com/auth/drive']
credentials = ServiceAccountCredentials.from_json_keyfile_name('НАЗВАНИЕ_ФАЙЛА.json', scope) #джейсонина-ключ
gc = gspread.authorize(credentials)
sh = gc.create('НАЗВАНИЕ_ФАЙЛА') #имя файла
sh.share('ПОЧТА_ЮЗЕРА', perm_type='user', role='owner') #права юзера - назначаем овнером
wks = sh.sheet1 #пишем на 1 вкладку
set_with_dataframe(wks, df)