从Jupyter笔记本复制数据 [英] Copy data from Jupyter notebook

查看:1530
本文介绍了从Jupyter笔记本复制数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从Jupyter笔记本复制和粘贴数据.按照下面的示例,其中包括InOut元素.

I would like to copy and paste data from a Jupyter notebook. As per the following example which includes the In and Out elements.

当尝试复制此数据时,由于单元格数据中不包含这些元素,我目前无法选择InOut元素.

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)

此图显示InOut元素以及单元格.我要复制并粘贴所有这些内容.

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.

丑陋的入侵:

步骤:

  1. 在浏览器中的In [number]上右键单击,然后单击检查元素
  1. 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&nbsp;[18]:</div>`

    在课程上
  1. 双击,然后从div元素中删除 prompt课程.删除后,它将如下所示:

  1. Double click on class and remove the prompt class from the div element. After removing it, it will look like this:

<div class="input_prompt">In&nbsp;[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笔记本复制数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆