To calculate the sum of values in a dataframe column in Python, simply use the sum() function on the column. In the example given, the sum of values in column 'C' would be 24.
About this solution: The candidate's solution is correct and efficient.
To calculate the percent change in stock prices, we can simply subtract the stock price on the previous day from the stock price on the current day, and divide by the previous day's stock price .
About this solution: The candidate's solution is optimal because it uses the built-in pct_change() function in pandas.
This technical problem deals with how to keep only certain columns in a dataframe using Python. A function is provided that takes in a dataframe and a list of column names, and returns a new dataframe with only the columns in the list. An example is given of input and output.
About this solution: This solution is complete and solves the problem. The approach is straightforward and easy to follow.