Skip to content
Texxl

From junior to geek the road is sleek

Find out dataframe index value under a certain condition

February 3, 2022 by admin

The simple code would be:


df.index[condition]

so something like this:


df.index[df['column1'] == True].tolist()

.tolist() is used when there are multiple values match the condition

Categories Pandas Tags condition, dataframe, index, pandas, value
Post navigation
Get actual value from pandas dataframe instead of object with index
AttributeError: ‘float’ object has no attribute ’round’

Categories

  • C#
  • Database
    • MariaDB
    • mySQL
  • git
  • Networking
    • Linux
    • nginx
    • Windows Server
  • Python
    • Anaconda
    • Cython
    • dask
    • Flask
    • Machine Learning
    • Numba
    • numpy
    • Pandas
    • plotly
  • Software
  • Uncategorized
  • Wordpress

Archives

  • September 2023 (2)
  • August 2023 (3)
  • July 2023 (2)
  • April 2023 (4)
  • February 2023 (1)
  • November 2022 (1)
  • September 2022 (4)
  • June 2022 (1)
  • May 2022 (1)
  • February 2022 (4)
  • December 2021 (5)
  • November 2021 (15)
  • October 2021 (5)
  • September 2021 (1)
  • August 2021 (3)
  • July 2021 (1)
  • June 2021 (10)
  • May 2021 (8)
  • April 2021 (5)

Popular Posts:

  • What is “if __name__ == ‘__main__’:” in Python?
  • How to create membership website with Flask
  • How to install hcloud on ubuntu 20
  • How to Establish a European Company in 5 Minutes: Start invoicing clients in 186 countries
  • How to install Kubernetes on Hetzner cloud step-by-step guide

9software.com - your one-stop software shop!

© 2023 Texxl • Built with GeneratePress