title: Number of rows within each window
body: <p>I have some expressions that I will evaluate later either within or without a window function. This normally works fine. Have <code>pl.col(&quot;x&quot;).max()</code>—add <code>.over(&quot;y&quot;)</code> later. Have <code>pl.arange(0, pl.count())</code>—add <code>.over(&quot;y&quot;)</code> later. One expression this does not work on is <code>pl.count()</code>.</p>
  <p>If you try to window <code>pl.count()</code>, Polars errors:</p>
  <pre class="lang-py prettyprint-override"><code>import polars as pl
  
  df = pl.DataFrame(dict(x=[1,1,0,0], y=[1,2,3,4]))
  expression = pl.count()
  
  df.with_column(expression.over(&quot;x&quot;).alias(&quot;z&quot;))
  # exceptions.ComputeError: Cannot apply a window function, did not find a root column. This is likely due to a syntax error in this expression: count()
  </code></pre>
  <p>Is there a version of <code>count</code> that can handle being windowed? I know that I can do <code>pl.col(&quot;x&quot;).count().over(&quot;x&quot;)</code>, but then I have to know ahead of time what columns will exist, and the expressions and the window columns come from completely different parts of my code.</p>