Question
Option 1 : [1.0, 3.0, 3.0, 3.0, 5.0] / [1.0, 3.0, 3.0, 3.0, 5.0]
Detailed Solution
सही उत्तर [1.0, 3.0, 3.0, 3.0, 5.0] / [1.0, 3.0, 3.0, 3.0, 5.0] है।
Question:
Predict the output of the following Python code: import pandas as pd; import numpy as np; s = pd.Series([1, np.nan, 3, np.nan, 5]); print(s.fillna(s.mean()).tolist()) / निम्नलिखित Python कोड के आउटपुट का अनुमान लगाइए:
Correct Answer: [1.0, 3.0, 3.0, 3.0, 5.0] / [1.0, 3.0, 3.0, 3.0, 5.0]
s.mean() ignores NaN and averages the present values, (1 + 3 + 5) / 3 = 3.0; fillna replaces both NaN entries with 3.0, giving [1.0, 3.0, 3.0, 3.0, 5.0]. / s.mean() NaN को अनदेखा कर उपस्थित मानों का औसत, (1 + 3 + 5) / 3 = 3.0 निकालता है; fillna दोनों NaN प्रविष्टियों को 3.0 से बदल देता है, जिससे [1.0, 3.0, 3.0, 3.0, 5.0] मिलता है।