0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Jupyter LabからQiitaへのPythonコード貼り付け

Last updated at Posted at 2019-08-10

この記事ではJupyter Labで作成したPythonコードをMarkdown形式で出力し、Qiitaへ貼り付ける方法を説明します。やり方は比較的簡単で以下の通り。

  1. Jupyter Labに適当なコードを打ち込む
  2. File -> Export Notebook As...からMarkdown形式で保存する
  3. Qiitaの記事を書くを開きMarkdownモードを選択
  4. 先ほど保存したMarkdown(.md)ファイルをテキストエディタ等で開き、中身をコピペする

以下はおなじみHello Worldのテスト

print("Hello World")
Hello World

グラフなど画像がある場合にはNotebookがzipファイルとして保存されるので、zipファイルの中の画像を編集画面で挿入する必要があります。

import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0,2*np.pi)
y = np.sin(x)
plt.plot(x,y)

output_4_1.png

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?