问题描述
我想从Jupyter笔记本复制和粘贴数据.按照下面的示例,其中包括In
和Out
元素.
I would like to copy and paste data from a Jupyter notebook. As per the following example which includes the In
and Out
elements.
当尝试复制此数据时,由于单元格数据中不包含这些元素,我目前无法选择In
和Out
元素.
When trying to copy this data I am currently unable to select the In
and Out
elements as these are not contained in the cell data.
In [23]:
df.index.slice_indexer(start_remove, end_remove)
Out[23]:
slice(36, 85, None)
此图显示In
和Out
元素以及单元格.我要复制并粘贴所有这些内容.
This image shows the In
and Out
elements as well as the cells. I want to copy and paste all of this.
推荐答案
减少丑陋的攻击:
您可以在检查工具的控制台中执行以下操作:
You can do this in console of Inspection Tool:
$('div.prompt').removeClass('prompt')
您不必刷新页面.您可以使用从所有div
元素中删除的prompt
类进行编码.您可以随时选择所需的内容.但是,如果您创建新的单元格,则必须再次运行.
And you don't have to refresh the page. You can carry on your coding with the prompt
class removed from all the div
elements. And you can select what you want at all times. But if you create new cells, you will have to run that again.
丑陋的入侵:
步骤:
- 在浏览器中的
In [number]
上右键单击,然后单击检查元素
- Right click on
In [number]
in your browser and click on Inspect Element
您将看到类似这样的内容:
You will see something like this:
`<div class="prompt input_prompt">In [18]:</div>`
- 在课程上
-
双击,然后从
div
元素中删除prompt
课程.删除后,它将如下所示:
Double click on class and remove the
prompt
class from thediv
element. After removing it, it will look like this:
<div class="input_prompt">In [18]:</div>
按Enter 并关闭检查工具.
现在单击并从In []
中的I
的左侧中进行选择,然后将鼠标拖到代码块中.
Now click and select from left of I
in In []
and drag your mouse inside the code block.
Voila!.您得到了想要的东西.
Voila! You got what you wanted.
您可以替换prompt
,也可以刷新页面.
这篇关于从Jupyter笔记本复制数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!