Nan values problem

Can i fill the nan value with different, values in each row

Yep, you can use .replace() method or .fillna() method to do so.

  1. .replace() : Python | Pandas dataframe.replace() - GeeksforGeeks
  2. .fillna() : Python | Pandas DataFrame.fillna() to replace Null values in dataframe - GeeksforGeeks
1 Like

As @bhupeshchandrawanshi said, you can fill the NaN values but it’s not always the case. If you don’t require that column or row or it is less significant to the analysis, you can also drop those columns or rows.

In your dataframe, looks like you can fill the city’s name with the given college name. But it’s up to you to decide what would be best for your analysis.

Personally, I do not prefer dropping NaN values in numerical rows and columns because that would also lead to the loss of much more available data. But as I said it’s up to you and the kind of analysis you are doing to decide what should be done.