Guess the meaningful replacement

Report a typo

You're provided with a small dataset with the following features:

  • livingspis the living area of an apartment;

  • nonlivingsp is the nonliving area of an apartment;

  • totsp is the total area of an apartment;

  • price is just price.

Load the given dataset into your IDE using pandas and find out the best way to fill NaNs. Then replace them and calculate the sum of all values in the column totsp . Insert the result in the answer field.

Note that we expect an integer as the answer for this task.

Tip: Finding the relationship between livingsp, nonlivingsp, and totsp is key to the solution.

Sample Input 1:

livingsp,nonlivingsp,totsp,price
16,11,NaN,121
29,12,41.0,152
24,9,NaN,101
20,8,28.0,187
17,12,29.0,129
16,12,NaN,137
28,7,NaN,101

Sample Output 1:

221
Write code in your IDE to process the text file and display the results below
___

Create a free account to access the full topic