---
source: crates/ruff_linter/src/rules/pandas_vet/mod.rs
---
PD101 Using `series.nunique()` for checking that a series is constant is inefficient
 --> PD101.py:7:1
  |
6 | # PD101
7 | data.nunique() <= 1
  | ^^^^^^^^^^^^^^^^^^^
8 | data.nunique(dropna=True) <= 1
9 | data.nunique(dropna=False) <= 1
  |

PD101 Using `series.nunique()` for checking that a series is constant is inefficient
  --> PD101.py:8:1
   |
 6 | # PD101
 7 | data.nunique() <= 1
 8 | data.nunique(dropna=True) <= 1
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 9 | data.nunique(dropna=False) <= 1
10 | data.nunique() == 1
   |

PD101 Using `series.nunique()` for checking that a series is constant is inefficient
  --> PD101.py:9:1
   |
 7 | data.nunique() <= 1
 8 | data.nunique(dropna=True) <= 1
 9 | data.nunique(dropna=False) <= 1
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10 | data.nunique() == 1
11 | data.nunique(dropna=True) == 1
   |

PD101 Using `series.nunique()` for checking that a series is constant is inefficient
  --> PD101.py:10:1
   |
 8 | data.nunique(dropna=True) <= 1
 9 | data.nunique(dropna=False) <= 1
10 | data.nunique() == 1
   | ^^^^^^^^^^^^^^^^^^^
11 | data.nunique(dropna=True) == 1
12 | data.nunique(dropna=False) == 1
   |

PD101 Using `series.nunique()` for checking that a series is constant is inefficient
  --> PD101.py:11:1
   |
 9 | data.nunique(dropna=False) <= 1
10 | data.nunique() == 1
11 | data.nunique(dropna=True) == 1
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12 | data.nunique(dropna=False) == 1
13 | data.nunique() != 1
   |

PD101 Using `series.nunique()` for checking that a series is constant is inefficient
  --> PD101.py:12:1
   |
10 | data.nunique() == 1
11 | data.nunique(dropna=True) == 1
12 | data.nunique(dropna=False) == 1
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13 | data.nunique() != 1
14 | data.nunique(dropna=True) != 1
   |

PD101 Using `series.nunique()` for checking that a series is constant is inefficient
  --> PD101.py:13:1
   |
11 | data.nunique(dropna=True) == 1
12 | data.nunique(dropna=False) == 1
13 | data.nunique() != 1
   | ^^^^^^^^^^^^^^^^^^^
14 | data.nunique(dropna=True) != 1
15 | data.nunique(dropna=False) != 1
   |

PD101 Using `series.nunique()` for checking that a series is constant is inefficient
  --> PD101.py:14:1
   |
12 | data.nunique(dropna=False) == 1
13 | data.nunique() != 1
14 | data.nunique(dropna=True) != 1
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
15 | data.nunique(dropna=False) != 1
16 | data.nunique() > 1
   |

PD101 Using `series.nunique()` for checking that a series is constant is inefficient
  --> PD101.py:15:1
   |
13 | data.nunique() != 1
14 | data.nunique(dropna=True) != 1
15 | data.nunique(dropna=False) != 1
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16 | data.nunique() > 1
17 | data.dropna().nunique() == 1
   |

PD101 Using `series.nunique()` for checking that a series is constant is inefficient
  --> PD101.py:16:1
   |
14 | data.nunique(dropna=True) != 1
15 | data.nunique(dropna=False) != 1
16 | data.nunique() > 1
   | ^^^^^^^^^^^^^^^^^^
17 | data.dropna().nunique() == 1
18 | data[data.notnull()].nunique() == 1
   |

PD101 Using `series.nunique()` for checking that a series is constant is inefficient
  --> PD101.py:17:1
   |
15 | data.nunique(dropna=False) != 1
16 | data.nunique() > 1
17 | data.dropna().nunique() == 1
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18 | data[data.notnull()].nunique() == 1
   |

PD101 Using `series.nunique()` for checking that a series is constant is inefficient
  --> PD101.py:18:1
   |
16 | data.nunique() > 1
17 | data.dropna().nunique() == 1
18 | data[data.notnull()].nunique() == 1
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19 |
20 | # No violation of this rule
   |
