Quantcast
Channel: Pandas dataframe, get the row and index for a column meeting certain conditions - Stack Overflow
Browsing latest articles
Browse All 3 View Live

Answer by quasi-human for Pandas dataframe, get the row and index for a...

You can also use a np.where method as follows:import numpy as npempty_status_idx = np.where(df.Status.isnull())[0].tolist()[0, 2]

View Article


Answer by sophocles for Pandas dataframe, get the row and index for a column...

You are overcomplicating it:empty_status_idx = df[df['Status'].isnull()].index.tolist()Out[65]: [0, 2]

View Article

Pandas dataframe, get the row and index for a column meeting certain conditions

I have the below df:import pandas as pdimport numpy as npoutput = [['Owner', 'Database', 'Schema', 'Table', 'Column', 'Comment', 'Status'], ['', 'DEV', 'AIRFLOW', 'TASK_INSTANCE', '_LOAD_DATETIME',...

View Article
Browsing latest articles
Browse All 3 View Live