最近、Python のモジュールであるPandasを使うことが多くそこではまたことで各要素の逆数が取れないことでした。 そこで、各演算についてまとめたいと思います。 DataFrameには以下のメソッドかあり利用することが出来る。 和 add(other) DataFrame + other 差 sub(other) DataFrame – other 積 mul(other) DataFrame * other 商 div(other) DataFrame / other 剰余 mod(other) DataFrame % other 乗算 pow(other) DataFrame ** other 更に演算方向が逆となる 和 radd(other) other + DataFrame 差 rsub(other) other – DataFrame 積 rmul(other) other
![[Python]PandasのDataFrameにおける逆数の取り方 | maluli](https://cdn-ak-scissors.b.st-hatena.com/image/square/99f8ef1328634a8e774fea72c1e6e646a5191b52/height=288;version=1;width=512/https%3A%2F%2Fmake-lush-life.net%2Fwp-content%2Fthemes%2Fluxech%2Fimages%2Fog.png)