31. A data professional is working with a pandas dataframe named sales that contains sales data for a retail website. They want to know the average price of an item. What code can they use to calculate the mean value of the Price column?

  • sales.mean().[Price]
  • sales = mean().Price
  • sales.(Price).mean()
  • sales[‘Price’].mean()

32. A data professional is working with a pandas dataframe. They want to select a subset of rows and columns by index. What method can they use to do so?

  • concat()
  • loc[]
  • iloc[]
  • merge()

33. Which of the following statements accurately describe Python tuples? Select all that apply.

  • Tuples can be split into separate variables.
  • Tuples are sequences.
  • Tuples are immutable.
  • Tuples cannot be split into separate variables.

34. A data professional is working with two Python sets. What function can they use to find the elements present in one set, but not the other?

  • intersection()
  • difference()
  • union()
  • Left

35. A data professional wants to merge two pandas dataframes. They want to join the data so all of the keys in the left dataframe are included—even if they are not in the right dataframe. What technique can they use to do so?

  • Outer join
  • Inner join
  • Right join
  • Left join

36. Which of the following statements accurately describe Python lists? Select all that apply.

  • Lists can be indexed and sliced.
  • Lists are immutable.
  • Lists are mutable.
  • Lists can contain sequences of elements of any data type.

37. A data professional is working with a NumPy array that has three rows and two columns. They want to change the data into two rows and three columns. What method can they use to do so?

  • agg()
  • type()
  • groupby()
  • reshape()

Leave a Reply