- 스터디에 참여해보세요!
관심있으면 바로 등록해보세요!
파이썬으로 나온 결과갑을 가지고 구글 시트로 연동하 후에 시각화 할수 있을 까요?
시각화 작업은 구글 시트 내에서는 어렵습니다.
그 데이터를 다시 파이썬으로 가져오셔서, 파이썬을 이용하여 시각화 하는건 당연히 가능합니다:)
스테이지4에서
gspread.exceptions.APIError: {'code': 403, 'message': 'The caller does not have permission', 'status': 'PERMISSION_DENIED'}
이런 에러가 납니다.
https://spreadsheets.google.com/feeds
이 주소에서는 아래 메시지가 나왔습니다.
현재 파일을 열 수 없습니다.
주소를 확인한 다음 다시 시도해 주세요.
시트에서도 공유권한을 설정하셔야 합니다. 혹시 지금은 해결 되셨는지요!
import gspread
from oauth2client.service_account import ServiceAccountCredentials
scope = ['https://spreadsheets.google.com/feeds']
creds = ServiceAccountCredentials.from_json_keyfile_name('key.json', scope)
client = gspread.authorize(creds)
sheet_url = 'https://docs.google.com/spreadsheets/d/1IZs-C6doyjn5n5BTrAdE2Wtl8nK-3EvVZC7csXduQQ8/edit#gid=0'
doc = client.open_by_url(sheet_url)
sheet1 = doc.worksheet('시트1')
cnt = int(sheet1.cell(1, 2).value)
print('기존 행수:', cnt)
sheet1.insert_row(['내용1', '내용2'], 3)
sheet1.update_cell(1, 2, str(cnt + 1))
코드파일 내용입니다. 동영상보고 타이핑해서 만들었습니다.
특별히 어디서 복사하실 필요 없구요, 코드가 매우 짧으니 직접 타이핑해서 옮기시면 됩니다:)