Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

pandas df.index.values

df = pd. read_csv("fruits.csv")
print(df)
index = df. index.
condition = df["fruit"] == "apple"
apples_indices = index[condition] get only rows with "apple"
apples_indices_list = apples_indices. tolist()
print(apples_indices_list)
Comment

PREVIOUS NEXT
Code Example
Python :: django httpresponse 
Python :: pickle python 
Python :: Iterate through string in python using for loop and rang 
Python :: python program to reverse a list 
Python :: python problem append same value 
Python :: how to add to a list python 
Python :: flip dictionary python 
Python :: dft numpz phase 
Python :: analog of join in pathlibn 
Python :: Chudnovsky algorithm in python codes 
Python :: python save image pytelegrambotapi 
Python :: index and reversing a sub list in python list 
Python :: Is there a do ... until in Python 
Python :: python check if attribute exists in dictionary 
Python :: how to close ursina screen 
Python :: usign signal files django 
Python :: python logging silent 
Python :: get admin url of instance django 
Python :: install requests-html in linux 
Python :: how to use ActionChains selenium python with WebDriverWait 
Python :: python switch case 
Python :: shibang for python file in linux 
Python :: python split space or tab 
Python :: how to get module path in python 
Python :: dataframe multiindex query 
Python :: get the first element that is larger than 
Python :: alphabeticallly 
Python :: access key through value python 
Python :: python use negation with maskedarray 
Python :: migrate database in django 
ADD CONTENT
Topic
Content
Source link
Name
4+1 =