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.

Unable to copy output of dataframe.columns from notebook or IW.

See original GitHub issue

Running the native interactive window using the latest Python and Jupyter extensions, I’m unable to copy text from the output of df.columns.

Minimal example:

  1. Open command palette and run “Jupyte Create Interactive Window”.
  2. Enter
    import pandas as pd
    
    df = pd.DataFrame(range(2), columns=['foobar'])
    df.columns
    
  3. Try to copy-paste the column name 'foobar' into the input field at the bottom of the window. Doesn’t work (for me).

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:15 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
janoshcommented, Oct 28, 2021

Trying to copy the result of a print statement, there’s a small warning that pops up briefly:

startindex 45 out of boundary

Screen Shot 2021-10-28 at 15 30 57

0reactions
janoshcommented, Oct 29, 2021

@rebornix Will wait for next week’s stable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Copying a column from one DataFrame to another gives NaN ...
Solution 1: Reset both DataFrames' indexes. You may prefer this option if you didn't mean to have different indices in the first place,...
Read more >
Data Types and Formats – Data Analysis and Visualization in ...
Objectives. Describe how information is stored in a Python DataFrame. Define the two main types of data in Python: text and numerics.
Read more >
How to avoid a Pandas pandemonium, Part I | by Pamela Wu
Internally, Pandas tries to optimize by returning a view or a copy depending on the DataFrame and the actions you take. You can...
Read more >
IO tools (text, CSV, HDF5, …) — pandas 1.5.2 documentation
The pandas I/O API is a set of top level reader functions accessed like pandas. read_csv() that generally return a pandas object. The...
Read more >
Spark SQL, DataFrames and Datasets Guide
A DataFrame is a Dataset organized into named columns. It is conceptually equivalent to a table in a relational database or a data...
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