pandas fill blanks with zero 1

pandas fill blanks with zero

column.fillna(0, inplace=True)

Here is what the above code is Doing:
1. We’re creating a new column called ‘total_sqft’
2. We’re using the apply() method to apply a function to each row of the column
3. The function we’re applying is the lambda function we defined above
4. The lambda function takes a row as input and returns the sum of the values in the ‘total_sqft_int’ and ‘total_sqft_float’ columns
5. We’re using the inplace parameter to make sure that the changes are saved to the dataframe

Similar Posts