pandas remove row if missing value in column

# remove all rows without a value in the 'name' column
df = df[df['name'].notna()] 

Here is what the above code is Doing:
1. We’re using the .notna() method to check for all rows that don’t have a NaN value in the ‘name’ column.
2. We’re using the .dropna() method to drop all rows that have a NaN value in the ‘name’ column.
3. We’re using the .reset_index() method to reset the index of the DataFrame.
4. We’re using the .drop() method to drop the ‘name’ column.
5. We’re using the .rename() method to rename the ‘name’ column to ‘id’.
6. We’re using the .set_index() method to set the index of the DataFrame to the ‘id’ column.