0
2

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.

Python Tips(予約語、組込みオブジェクト、関数の説明表示、コメント、マジックコマンド)

Posted at

使うけど毎回検索してしまうTipsを整理。

Python Tips

予約語の確認方法

import('keyword').kwlist

組込みオブジェクトの確認方法

dir(builtins)

jupyter notebook

関数の説明表示方法

shift + tab
「(関数)?」を記載し実行

コメント

コメント行選択した状態で、command + /

マジックコマンド

Jupyter上で「%」を記載して実行できる命令文。
[公式URL]
https://ipython.readthedocs.io/en/stable/interactive/magics.html

マジックコマンドの種類

% : 一行を対象とする
%% : セル全体を対象とする

使えるマジックコマンド

%lsmagic :コマンドの一覧のみ。
%quickref : その他マジックコマンドを表示。簡単な説明付き。
%time : 実行時間の測定
%timeit : 何回か試し、最速と平均時間を返す
%sql : DBへクエリを投げることができる
%matplotlib inline : jupyter内にグラフを表示
%precision : 少数の桁数を指定

0
2
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
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?