Answer the question
In order to leave comments, you need to log in
How to add a Google Sheet column to a specific location (Python, gspread)?
How to add a Google Sheet column to a specific location (Python, gspread)?
There is a function add_cols(cols)
but it adds a column to the end, but you need to insert it in a certain place
Answer the question
In order to leave comments, you need to log in
Use the core API
sht = gc.open_by_key(spreadsheetId)
requests = []
requests.append({
"insertDimension": {
"range": {
"sheetId": sheetId,
"dimension": "COLUMNS",
"startIndex": 2,
"endIndex": 4
},
"inheritFromBefore": True
}
})
body = {
'requests': requests
}
sht.batch_update(body)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question