I'm trying to get the total market cap in a sector by day. I'm new to coding in general as you can probably tell. I think I'm on the right track but I can't figure out how to sum the market cap for all stocks in my universe daily. I have tried tech_stocks['market_cap'].sum() but it adds all the days together. Just to be clear because I'm new to this and don't know if I'm explaining it right, I want to end up with one market cap number per trading day that is the sum of my selected stocks market caps. I'm planning on plotting this along with a moving average of the market cap. Also, I have a price filter to limit the selection until I get it working to make the data easier to handle.
Thanks for helping me out.
PS - I'm aware that their are Sector ETF's and such that I could use instead, but at this point I just want to figure out how to do it myself. It's not for any real world trading, just learning.