I am trying to convert the Python code:

        df = self.algo.History(
           [self.symbol_object], 
           self.min_bars,
           Resolution.Daily
           )
           
       # Drops level 0 (Symbols), so only time as index
       df.reset_index(level=0, inplace=True)
       
       # Get only the desired columns
       columns = ['open', 'high', 'low', 'close', 'volume']
       try:
           df = df[columns]
           # Drop all rows with nans
           df.dropna(inplace=True)
       except:
           self.algo.Debug(f"{self.symbol} ERROR warming up indicators")
           return

The call to algo.History returns an IEnumerable<Slice>. How do I take this list and apply:

  1. df.reset_index()
  2. df = df[columns]
  3. df.dropna()

Do I need to walk the enumeration copying over to a new list? I can do that but if there's a C# call that does the equivilent, that would be better I think.

And more basically, do I even need to do this reduction? Or should I skip those 3 steps and iterate through the Slice elements, skipping any that have a N/A? Because I don't see any reason to need to eliminate keys or values when I can just ignore them.

??? - thanks - dave