title: Using Pythonnet, how to handle output in C#?
body: <p>Here is the code of Python:</p>
  <pre><code>import trendln
  import yfinance as yf # requires yfinance - pip install yfinance
  tick = yf.Ticker('^GSPC') # S&amp;P500
  hist = tick.history(period=&quot;max&quot;, rounding=True)
  h = hist[-1000:].Close
  mins, maxs = trendln.calc_support_resistance(h)
  </code></pre>
  <p>Here,</p>
  <pre><code>type(tick)
  &lt;class 'yfinance.ticker.Ticker'&gt;
  type(hist)
  &lt;class 'pandas.core.frame.DataFrame'&gt;
  type(h)
  &lt;class 'pandas.core.series.Series'&gt;
  type(mins) and type(maxs)
  &lt;class 'tuple'&gt;
  </code></pre>
  <p>I have tried this:</p>
  <pre><code>using (Py.GIL())
  {
      dynamic tick = yf.Ticker(&quot;^GSPC&quot;);
      dynamic hist = tick.history(&quot;max&quot;,true);
  }
  </code></pre>
  <p>But I do not understand how I can handle the data the same way in Python.</p>
  <p>To be Specific, How I can handle the dataframe and Tuples which in the style like this <code>h = hist[-1000:].Close</code> and <code>mins/maxs</code> in C#.</p>
  <p>Please suggest me the easiest way to do that.</p>