0
0

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 1 year has passed since last update.

チルダ記号を使って条件を反転させる

Posted at

チルダ記号 ~


a = df[~df["カラム1"] <= 100) ]

この~ヘナヘナマークがチルダ。
notみたいな意味合いで使われ、条件が逆転する。
上記だと100以下が取得されるが、チルダの役割により100以上のデータが取得されるようになる。

最初試した時は、エラーになりましたが()を挟むことにより動いてくれました。
うまいくいかないときは、~()でかくといいかもしれない。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?