グラフの描画

import numpy as np
import matplotlib.pyplot as plt
def main():
	x=np.arange(0,8,0.1)
	y=np.cos(x)
	plt.plot(x,y)
	plt.show()
if __name__ == '__main__':
main()

ここで,

if __name__ == '__main__':

__name__ という変数には,Pythonファイルのモジュール名が文字列で入力される.一方で,この文字列はPythonファイルをスクリプトとして直接実行した場合には,"__main__"に自動で設定される.

Mathematics is the language with which God has written the universe.





















MongoDBをインストール T空間 確率分布 準凹関数と凹関数 群の準同型写像 ラグランジアン