<div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div>Just reply to the discussion, I may have made a boo boo in replying to your first post.</div><div><br></div><div>I'm curious. Implementing NumPy in another language seems like quite a bit of work. Did you have any tools to make it easier? I assume the C api is gone, so that the translation is NumPy program specific. I've never used C#, was there a reason to avoid C? What about IronPython? IIRC there was some work to make NumPy run on IronPython before that project was ended. I'm also curious what the application was that made it impossible to stay with python, I suppose the customer wanted C#, but I'd like to know why plain old Python was not an option. </div><br></div></div></blockquote><div><br></div><div>Chuck,</div><div><br></div><div>To start: I'd like to be clear that I'm not trying to speak for the OP, but I thought I'd share my experiences.</div><div><br></div><div>I'm a civil engineer who adopted Python early in his career and became the "data guy" in the office pretty early on. Our company's IT department manages lots of Windows Servers running SQL Server. In my case, running python apps on our infrastructure just isn't feasible or supported by the IT department. Typically, we move to outside hosting when we're going that route. However, sometimes there are a litany of reasons to stay with our in house infrastructure. In that case, C# makes it very simple to set up and deploy a web API against a SQL Server database. It's very much a walled-garden approach to the web, but it can be quite efficient, especially when you're billing clients by the hour. Additionally, C#'s ORM treats each table in the database pretty much as dataframe. I've ported many of my pandas-based workflows over to C# without much issue.</div><div><br></div><div>For example in C# I did:</div><div><br></div><div>

<div style="color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:Consolas,"Courier New",monospace;font-weight:normal;font-size:13px;line-height:18px;white-space:pre">

<div style="color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:Consolas,"Courier New",monospace;font-weight:normal;font-size:13px;line-height:18px;white-space:pre"><div><span style="color:rgb(0,16,128)">var results = StormEvent</span></div><div><span style="color:rgb(0,0,0)">    .</span><span style="color:rgb(121,94,38)">Where</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,16,128)">se</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(0,0,0)">=></span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(0,0,255)">new</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(38,127,153)">List</span><span style="color:rgb(0,0,0)"><</span><span style="color:rgb(38,127,153)">String</span><span style="color:rgb(0,0,0)">> { </span><span style="color:rgb(163,21,21)">"CI"</span><span style="color:rgb(0,0,0)">, </span><span style="color:rgb(163,21,21)">"JI"</span><span style="color:rgb(0,0,0)"> }.</span><span style="color:rgb(121,94,38)">Contains</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,16,128)">se</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(0,16,128)">MonitoringLocations</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(0,16,128)">sitename</span><span style="color:rgb(0,0,0)">))</span></div><div><span style="color:rgb(0,0,0)">    .</span><span style="color:rgb(121,94,38)">Where</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,16,128)">se</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(0,0,0)">=></span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(0,16,128)">se</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(0,16,128)">pCoseParameter</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(0,16,128)">pName</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(121,94,38)">ToLower</span><span style="color:rgb(0,0,0)">().</span><span style="color:rgb(121,94,38)">Contains</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(163,21,21)">"flow"</span><span style="color:rgb(0,0,0)">))</span></div><div><span style="color:rgb(0,0,0)">    .</span><span style="color:rgb(121,94,38)">Where</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,16,128)">se</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(0,0,0)">=></span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(0,16,128)">se</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(0,16,128)">wateryear_int</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(121,94,38)">Equals</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(9,136,90)">2014</span><span style="color:rgb(0,0,0)">))</span></div><div><span style="color:rgb(0,0,0)">    .</span><span style="color:rgb(121,94,38)">GroupBy</span><span style="color:rgb(0,0,0)">(</span></div><div><span style="color:rgb(0,0,0)">        </span><span style="color:rgb(0,16,128)">se</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(0,0,0)">=></span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(0,0,255)">new</span><span style="color:rgb(0,0,0)"> {</span><span style="color:rgb(0,16,128)">se</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(0,16,128)">MonitoringLocations</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(0,16,128)">sitename</span><span style="color:rgb(0,0,0)">, </span><span style="color:rgb(0,16,128)">se</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(0,16,128)">paramName</span><span style="color:rgb(0,0,0)">},</span></div><div><span style="color:rgb(0,0,0)">        (</span><span style="color:rgb(0,16,128)">key</span><span style="color:rgb(0,0,0)">, </span><span style="color:rgb(0,16,128)">df</span><span style="color:rgb(0,0,0)">) </span><span style="color:rgb(0,0,0)">=></span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(0,0,255)">new</span></div><div><span style="color:rgb(0,0,0)">        {</span></div><div><span style="color:rgb(0,0,0)">            </span><span style="color:rgb(0,16,128)">ml</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(0,16,128)">key</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(0,16,128)">sitename</span><span style="color:rgb(0,0,0)">,</span></div><div><span style="color:rgb(0,0,0)">            </span><span style="color:rgb(0,16,128)">param</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(0,16,128)">key</span><span style="color:rgb(0,0,0)">.<span style="color:rgb(0,16,128)">param</span></span><span style="color:rgb(0,16,128)">Name</span></div><div><span style="color:rgb(0,0,0)">            </span><span style="color:rgb(0,16,128)">total</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(0,16,128)">df</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(121,94,38)">Select</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(0,16,128)">d</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(0,0,0)">=></span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(0,16,128)">d</span><span style="color:rgb(0,0,0)">.</span><span style="color:rgb(0,16,128)">paramValue</span><span style="color:rgb(0,0,0)">).</span><span style="color:rgb(121,94,38)">Sum</span><span style="color:rgb(0,0,0)">()</span></div><div><span style="color:rgb(0,0,0)">        }</span></div><div><span style="color:rgb(0,0,0)">    );</span></div></div>

</div>

</div><div><br></div></div><div class="gmail_quote">Whereas in pandas I would do:</div><div class="gmail_quote"><br></div><div class="gmail_quote">

<div style="color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:Consolas,"Courier New",monospace;font-weight:normal;font-size:13px;line-height:18px;white-space:pre"><div><span style="color:rgb(0,0,0)">results = (</span></div><div><span style="color:rgb(0,0,0)">    StormEvents</span></div><div><span style="color:rgb(0,0,0)">        .merge(MonitoringLocations, </span><span style="color:rgb(0,16,128)">on</span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(163,21,21)">'monlocID'</span><span style="color:rgb(0,0,0)">, </span><span style="color:rgb(0,16,128)">lsuffix</span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(163,21,21)">'_ml'</span><span style="color:rgb(0,0,0)">, </span><span style="color:rgb(0,16,128)">rsuffix</span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(163,21,21)">''</span><span style="color:rgb(0,0,0)">)</span></div><div><span style="color:rgb(0,0,0)">        .merge(Parameters, </span><span style="color:rgb(0,16,128)">on</span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(163,21,21)">'paramID'</span><span style="color:rgb(0,0,0)">, </span><span style="color:rgb(0,16,128)">lsuffix</span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(163,21,21)">'_param'</span><span style="color:rgb(0,0,0)">, </span><span style="color:rgb(0,16,128)">rsuffix</span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(163,21,21)">''</span><span style="color:rgb(0,0,0)">)</span></div><div><span style="color:rgb(0,0,0)">        .loc[</span><span style="color:rgb(0,0,255)">lambda</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(0,16,128)">x</span><span style="color:rgb(0,0,0)">: x[</span><span style="color:rgb(163,21,21)">'sitename'</span><span style="color:rgb(0,0,0)">].isin([</span><span style="color:rgb(163,21,21)">'CI'</span><span style="color:rgb(0,0,0)">, </span><span style="color:rgb(163,21,21)">'CI'</span><span style="color:rgb(0,0,0)">])]</span></div><div><span style="color:rgb(0,0,0)">        .loc[</span><span style="color:rgb(0,0,255)">lambda</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(0,16,128)">x</span><span style="color:rgb(0,0,0)">: x[</span><span style="color:rgb(163,21,21)">'param'</span><span style="color:rgb(0,0,0)">].str.lower().str.contains(</span><span style="color:rgb(163,21,21)">"flow"</span><span style="color:rgb(0,0,0)">)]</span></div><div><span style="color:rgb(0,0,0)">        .loc[</span><span style="color:rgb(0,0,255)">lambda</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(0,16,128)">x</span><span style="color:rgb(0,0,0)">: x[</span><span style="color:rgb(163,21,21)">'wateryear_int'</span><span style="color:rgb(0,0,0)">] </span><span style="color:rgb(0,0,0)">==</span><span style="color:rgb(0,0,0)"> </span><span style="color:rgb(9,136,90)">2014</span><span style="color:rgb(0,0,0)">]</span></div><div><span style="color:rgb(0,0,0)">        .groupby(</span><span style="color:rgb(0,16,128)">by</span><span style="color:rgb(0,0,0)">=</span><span style="color:rgb(0,0,0)">[</span><span style="color:rgb(163,21,21)">'sitename'</span><span style="color:rgb(0,0,0)">, </span><span style="color:rgb(163,21,21)">'paramID'</span><span style="color:rgb(0,0,0)">])</span></div><div><span style="color:rgb(0,0,0)">        .sum()['paramValue']</span></div><div><span style="color:rgb(0,0,0)">)</span></div></div>

</div><div class="gmail_quote"><div><br></div><div>I'm not trying to sell you on C#, I'll always go python if I can. But depending on your organization's infrastructure and project constraints, it can be surprisingly pleasant to work with.</div><div><br></div><div>The point of all of this is that in those situations, have a numpy-like library would be very nice indeed. I've very excited to hear that the OP's work has been open sourced.</div><div><br></div><div>Kudos!</div><div>-Paul<br></div></div></div></div>