Mid-levelMultiple choiceWhat is the difference between .apply() and .map() in pandas?A.map() works on both Series and DataFrames, while .apply() works only on Series.B.map() is used for DataFrame-wide operations, while .apply() is for Series-wide operations.C.apply() applies functions element-wise, while .map() applies functions to entire columns.D.apply() works on both Series and DataFrames, while .map() works only on Series.Check answer
JuniorMultiple choiceGiven two arrays, write a Python function to return the intersection of the two. For example, X = [1,5,9,0] and Y = [3,0,2,9] should return [9,0].AUse a for loop to check each element in both arrays.BUse the set intersection method on the two arrays.CUse list comprehension to filter common elements.DUse a while loop to iterate through both arrays.Check answer
JuniorMultiple choiceDefine tuples and lists in Python. What are the major differences between them?ATuples consume more memory than lists.BLists are faster than tuples for iteration.CLists are mutable, tuples are immutable.DTuples are mutable, lists are immutable.Check answer
Mid-levelMultiple choiceWhat is the difference between the apply and applymap functions in pandas?Aapply is used for element-wise operations, applymap for row/column-wise.Bapply is used for row/column-wise operations, applymap for element-wise.Capplymap is used for transformations, apply for aggregations.Dapply returns only DataFrames, applymap can return Series.Check answer
JuniorMultiple choiceWhat is Flask and what are its benefits?AFlask is an operating system designed for high-performance computing.BFlask is a machine learning library used for data preprocessing and model training.CFlask is a database management system used for handling large datasets.DFlask is a web framework that provides tools and libraries for building web applications.Check answer