comment

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

関連記事

no image

python3 で、ファイルのパスから、拡張子を取り除く方法

os モジュールを使って、ファイル操作をすることができる。 ファイル名にドット. が複数の拡張子がついている場合には、拡張子を取り除く操作を何回か繰り返す。 例 import os path0 = ” …

no image

python3 で、pathlib を使ってファイルの拡張子を取得する方法

pathlib モジュールの stem を使う。 この書き方は、python 3.4 以降で使えるようになった。 https://docs.python.org/3/library/pathlib.h …

no image

matplotlib で折れ線グラフの下部に色をつけて塗りつぶす方法

pyplot の fill_between を使う。 例 from matplotlib import pyplot as plt data_x = [25,26,27] data_y = & …

no image

matplotlib で、縦横の罫線を引く方法

破線をカスタマイズする方法 以下では、dashes = [5,2,2,2] で、線5・空白2・線2・空白2の破線を指定している。 詳しくは次を参照。 https://matplotlib.org/st …

no image

python3 で、すべて小文字かどうかを判定する方法

islower() 関数を使う。 例 print(‘abcde’.islower()) print(‘abcDe’.islower()) 結果 True False