articlesDf = articlesDf.groupby("col").count()

articlesDf = articlesDf.groupby("col").count()

B. 4, 5

C. 2, 5, 3

D. 5, 2

E. 2, 3, 4

F. 2, 5, 4

Answer: E

Explanation:

Correct code block:

articlesDf = articlesDf.select(explode(col(‘attributes’)))

articlesDf = articlesDf.groupby(‘col’).count()

articlesDf = articlesDf.sort(‘count’,ascending=False).select(‘col’)

Output of correct code block:

+——-+

| col|

+——-+

| summer|

| winter|

| blue|

| cozy|

| travel|

| fresh|

| red|

|cooling|

| green|

+——-+

Static notebook | Dynamic notebook: See test 2,

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>