1

I have a set of data with various stock symbols and would like to know how many bullish and bearish signals there were for each symbol for each day.

How would I do this with Pandas? Thanks

Input:      
Date    Symbol  Sentiment
5/2/19  GE      Bullish
5/2/19  GE      Bullish
5/2/19  GE      Bearish
5/2/19  GE      Bearish
6/2/19  GE      Bullish
6/2/19  GE      Bullish
6/2/19  GE      Bullish
6/2/19  GE      Bullish
6/2/19  GE      Bullish
6/2/19  GE      Bearish
6/2/19  GE      Bearish
6/2/19  GE      Bearish



Output:         
Date    Symbol  Sentiment Bullish   Sentiment Bearish
5/2/19  GE      2                   2
6/2/19  GE      5                   3
smci
  • 32,567
  • 20
  • 113
  • 146
nicholas.reichel
  • 2,260
  • 7
  • 20
  • 28

0 Answers0