You will find, with pandas alone, the elements of periods 2 and 3 whose first ionisation enthalpy falls below the element before, and the mean of each block.
The idea. df.groupby("period")["ie"].diff() gives the change from the element before, inside each period. A negative change is a break. groupby("block")["ie"].mean() gives the mean of each block.
Your tasks.
rise: the change from the element before, inside each period.breaks to the list of symbols whose rise is below zero.block_mean to a dictionary of the mean ionisation enthalpy of each block, rounded to one place.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…