comment

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

関連記事

no image

正規表現でプラス(+)の意味

+記号は、1文字以上の繰り返しを表す。 あてはまる文字が0文字の場合は表現しない。 例 [A-Z]+ あてはまる文字列 ABCC ZYXEFG あてはまらない文字列 123 ABC9

no image

python3 で、文字列の最後が特定の文字で終わるか判定する方法

endswith を使う。 例 str1 = “こんにちは” result1 = str1.endswith(“は”) result2 = str1.endswith(“わ”) print(resul …

no image

tex で箇条書きをする方法

箇条書きをしたい部分を\begin{\itemize} と\end{itemize} で囲い、項目ごとに \item で箇条書きをすることができる。 例 \begin{itemize}     \it …

no image

matplotlib のプロットスクリプト内で計算する方法

gnuplot の場合 gnuplot では、plot “data.txt” u 1:($2*2)などと書くと、 数値を加工(データ値を使った計算)を行った結果をグラフ化するこ …

no image

python3 で、dictionary のキー一覧を取得する方法

dict.keys() でキーを取得することができる。 参考:dictionary の値一覧を取得するときは、dict.values() を使う。 例 print(dict.keys())