title: How to fill missing value with different ways in python?
body: <p>I have a dataset that has a number of numerical variables and a number of ordinal numeric variables. to fill missing value  I want to  use mean for numerical variables and use the median for the ordinal numeric variables. With the following code, each of them is created separately and is not collected in a database.</p>
  <pre><code>df = [['age', 'score'],
   [10,1],
   [20,&quot;&quot;],
   [&quot;&quot;,0],
   [40,1],
   [50,0],
   [&quot;&quot;,3],
   [70,1],
   [80,&quot;&quot;],
   [90,0],
  [100,1]]
  
  df = pd.DataFrame(data[1:])
  df.columns = data[0]
  
  df = df[['age']].fillna(df.mean())
  df = df[['score']].fillna(df.median())
  </code></pre>