12

If I rightclick and select Copy Value

enter image description here

it copies corrupted excerpt only:

enter image description here

In 21st century wasn't it possible to just send all the numbers to clipboard?

Dims
  • 47,675
  • 117
  • 331
  • 600

3 Answers3

11

Say your NumPy array is mynparray. Then you can do

import pandas as pd
df = pd.DataFrame(mynparray)
df.to_clipboard(index=False,header=False)
flow2k
  • 3,999
  • 40
  • 55
  • I wanted to thank you so much for this solution. It works really awesome for me. – afp_2008 Jan 12 '22 at 00:43
  • 1
    On Linux you must install a package for this to work; none of which worked for me. https://pyperclip.readthedocs.io/en/latest/#not-implemented-error – Noumenon Jan 20 '22 at 09:31
2

Looks like a PyCharm bug: max buffer size is 255.

Try this workaround: press Insert and evaluate print(dat). The value will be dumped to console, where copy is working fine.

Also you can go ahead and evaluate pyperclip.copy(str(dat)) to copy in python (see this question).

Maxim
  • 52,561
  • 27
  • 155
  • 209
2
print(dat.tolist())

and then copy it from the run Console

mousomer
  • 2,632
  • 2
  • 24
  • 25