Considering the following dataset called "df":
Name | Sex
John | man
Peter| man
Henry| man
Mary | woman
I would like to define a function that returns me this:
Percentage of men: 75%
Percentage of women: 25%
I'm having trouble because "men" and "women" are string type and to add the percentage symbol (%). Also I would like to clarify that I'm using IntelliJ to code in Scala.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…