question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

call col_values via letters identifying the column

See original GitHub issue

When I need to append values in columns where there may be blank values, for example:

row 1
row 2
row 3


row 6

It is necessary to collect the column values to calculate which first row will be empty to append the new values:

sheet = client.open_by_key('XXX').worksheet("GSPREAD")
rows = sheet.col_values(3)
new = [['b'],['c'],['b'],['c'],['b'],['c']]
sheet.append_rows(new,table_range='C'+ str(len(rows)+1))

To reduce the risk of errors in updates, for example, I used to add values it to column 3 (‘C’), now I’m going to add it to column 1 (‘A’), sometimes accidentally forget to change one or the other for the difference display between letters and numbers.

Because col_values uses numbers. append_rows table_range uses letters.

If there was an option to use letters in col_values I could create a single object (col) for both calls:

sheet = client.open_by_key('XXX').worksheet("GSPREAD")
col = 'C'
rows = sheet.col_values(col)
new = [['a'],['b'],['c'],['d'],['e'],['f']]
sheet.append_rows(new, table_range = col + str(len(rows)+1))

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
lavigne958commented, Jul 3, 2022

alright then, let’s go for it, this goes to the milestone for the next release !

0reactions
fredericomattoscommented, Jul 3, 2022

Really, this way could use it for all other functions instead of changing all the functions to accept letters and numbers, cool, I liked your idea of adding it to utils!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Columns and rows are labeled numerically in Excel
These letters and numbers are called row and column headings. To refer to a cell, type the column letter followed by the row...
Read more >
How to show column number - Excelchat - Got It AI
Want to learn how to show column numbers in Excel? This article will give you a step-by-step tutorial on how to show column...
Read more >
Simulate autofit column in xslxwriter - python - Stack Overflow
As a general rule, you want the width of the columns a bit larger than the size of the longest string in the...
Read more >
Excel ADDRESS function to get cell address and more - Ablebits
Return cell value based on row and column numbers · Get address of cell with highest or lowest value · Get column letter...
Read more >
An introduction to the SingleCellExperiment class - Bioconductor
For example, if we have a count matrix in counts , we can simply call: ... access to assay data via assay() ,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found