t2.py 229 B

12345678910111213
  1. import pandas as pd
  2. letter = ['B', 'A', 'C', 'D', 'A', 'C', 'D', 'A']
  3. df = pd.Series(letter)
  4. ct = df.value_counts()
  5. print(ct.index)
  6. for k, v in ct.items():
  7. # print(k, v)
  8. pass
  9. print("B", ct["B"])
  10. print("B" in ct.index)