Fill the nans from the left with fillna
, then get the leftmost column:
df.fillna(method='bfill', axis=1).iloc[:, 0]
More Related Contents:
- error when applying function to a series object
- How to group dataframe rows into list in pandas groupby
- Groupby value counts on the dataframe pandas
- Pandas: Chained assignments [duplicate]
- Apply pandas function to column to create multiple new columns?
- Reading an Excel file in python using pandas
- Python Pandas: Get index of rows which column matches certain value
- Python: Convert timedelta to int in a dataframe
- How to insert pandas dataframe via mysqldb into database?
- Pandas make new column from string slice of another column
- Update a dataframe in pandas while iterating row by row
- Conditionally format Python pandas cell
- import csv with different number of columns per row using Pandas
- Selecting columns from pandas MultiIndex
- How to concatenate multiple column values into a single column in Pandas dataframe
- Python Pandas write to sql with NaN values
- Pandas style function to highlight specific columns
- pandas.io.json.json_normalize with very nested json
- Python pandas convert datetime to timestamp effectively through dt accessor
- Checking if particular value (in cell) is NaN in pandas DataFrame not working using ix or iloc
- Time Series Analysis – unevenly spaced measures – pandas + statsmodels
- Move column by name to front of table in pandas
- matplotlib savefig() size control
- Is there a way to speed up handling large CSVs and dataframes in python?
- How to use numpy to get the cumulative count by unique values in linear time?
- Using regex matched groups in pandas dataframe replace function
- converting list of header and row lists into pandas DataFrame
- How to return a csv file/Pandas DataFrame in JSON format using FastAPI?
- How to get number of groups in a groupby object in pandas?
- Python generating a list of dates between two dates