Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return Data to sheet -> List of Values not copyable? #975

Closed
N-Demir opened this issue Jan 10, 2024 · 4 comments
Closed

Return Data to sheet -> List of Values not copyable? #975

N-Demir opened this issue Jan 10, 2024 · 4 comments

Comments

@N-Demir
Copy link
Contributor

N-Demir commented Jan 10, 2024

Hi! Question/feature. I used some python code to generate a new column in my data by having the last line in the code be a list of strings. However, when I go to do something with this new column like copy one of the values I'm not able to. The outputted data is sort of like a ghost where it displays but if i double click there is nothing there. And copying doesn't grab anything.

Am I missing something on how to work with the data? It seems like outputting a list of values back to the sheet is for viewing only, and there's no way to actually then use it.

Strangely I can reference the values by doing cell(0, -124), for example:
Screenshot 2024-01-09 at 4 45 49 PM

but without relative cell positioning syntax or a function to get the position of the current cell (unless I'm missing it), I can't use this hack to populate a new column with copyable values.

@davidkircos
Copy link
Collaborator

When you output data from a cell, it "expands" onto the grid, only if there is the available space to do so. If there is user data or another code cell in the way you get a "SPILL" error (we could document this better).

Copy/paste should copy the values and I believe it is an oversight that it currently does not. It's not a trivial solution, however. If you copy the source cell, we want the code to be copied, but if you don't copy the source cell we just want to copy the values.

This is a little confusing.

@N-Demir
Copy link
Contributor Author

N-Demir commented Jan 10, 2024

I can definitely see how it would be tricky... I'm not familiar how other spreadsheets have solved it and whether they've found the right solution or it still has issues (iirc gsheets frustrated me here for some reason before, could be making that up though)

I differ to your judgements on whether this makes any sense, but conceptually is it easier to think that there are 2 levels of copying: values and formulas/code?

Sort of like programmers are familiar with shallow and deep copies. The basic copy is just a shallow copy i.e. it only copies values, and a "deeper" copy copies the underlying code.

Shallow copy = cmd + c
Deep copy = cmd + shift + c (or, and this is maybe unusual from an HCI perspective, could also be cmd + c hit twice in quick succession

I realize this probably ties into quadratic fundamentals, like what gets copied when your click and drag the corner of a cell and I'm sure other things I'm not aware of

@N-Demir
Copy link
Contributor Author

N-Demir commented Jan 10, 2024

fwiw, if someone else finds this, I was able to find a workaround:

copy the "display only" outputted cells from a formula and go to the {} in the menu and click "export -> download selection as csv"

this downloads the list of values and you can then drag and drop it into the spreadsheet somewhere else

@davidfig
Copy link
Collaborator

davidfig commented Feb 1, 2024

This is now fixed. You can copy parts of a code cell output and paste them as values. You can also copy the entire output and use the paste values only (found via the command palette, the floating menu in the "..." area, or with Cmd/Ctrl + Shift + V).

@davidfig davidfig closed this as completed Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants