title: Convert javascript object to polars dataframe in node.js and populate missing values with null
body: <p>I'm trying to use <a href="https://pola-rs.github.io/polars/nodejs-polars/html/index.html" rel="nofollow noreferrer"><code>nodejs-polars</code></a> library but have encountered a problem converting a <em>javascript</em> object to a <em>polars</em> dataframe.</p>
  <p>Consider the following data for example</p>
  <pre class="lang-js prettyprint-override"><code>const myData = [
      {
          &quot;id&quot;: &quot;a&quot;,
          &quot;name&quot;: &quot;fred&quot;,
          &quot;country&quot;: &quot;france&quot;,
          &quot;age&quot;: 30,
          &quot;city&quot;: &quot;paris&quot; // there's no &quot;city&quot; property elsewhere in `myData`
      },
      {
          &quot;id&quot;: &quot;b&quot;,
          &quot;name&quot;: &quot;alexandra&quot;,
          &quot;country&quot;: &quot;usa&quot;,
          &quot;age&quot;: 40
      },
      {
          &quot;id&quot;: &quot;c&quot;,
          &quot;name&quot;: &quot;george&quot;,
          &quot;country&quot;: &quot;argentina&quot;,
          &quot;age&quot;: 50
      }
  ]
  </code></pre>
  <p>So if we do</p>
  <pre class="lang-js prettyprint-override"><code>const pl = require(&quot;nodejs-polars&quot;)
  
  const output = pl.DataFrame(myData)
  </code></pre>
  <p>We get the error:</p>
  <blockquote>
  <p>Error: Lengths don't match: Could not create a new DataFrame from Series. The Series have different lengths</p>
  </blockquote>
  <p>Is there no way to create a <em>polars</em> dataframe from object such that it will automatically populate missing values with <code>null</code>?</p>