and Answers 100% Pass
What is the primary library in Python for data analysis?
✔✔ pandas
What function is used to read a CSV file in Python using pandas?
✔✔ pd.read_csv()
What is the purpose of the pandas DataFrame?
✔✔ To store and manipulate tabular data in rows and columns
What is the difference between a list and a DataFrame in Python?
✔✔ A list is a basic data structure for holding ordered items, while a DataFrame is a 2-
dimensional table that allows for data manipulation and analysis
How can you drop missing values from a DataFrame in pandas?
✔✔ df.dropna()
1
,How can you fill missing values in a DataFrame in pandas?
✔✔ df.fillna(value)
What does the `groupby()` function in pandas do?
✔✔ It splits the data into groups based on some criteria and applies a function to each group
How do you create a plot in Python using matplotlib?
✔✔ plt.plot(x, y)
What is the purpose of the `pivot_table()` function in pandas?
✔✔ It creates a summary table by aggregating data based on certain keys
What is the use of the `.iloc[]` indexer in pandas?
✔✔ It allows for indexing by position to access rows and columns
What is a NumPy array?
✔✔ A multidimensional array used to store numerical data and perform vectorized operations
2
, How can you merge two DataFrames in pandas?
✔✔ pd.merge(df1, df2, on='key')
What is the purpose of the `.apply()` function in pandas?
✔✔ It applies a function along an axis (rows or columns) of a DataFrame
How do you calculate the correlation between two columns in a pandas DataFrame?
✔✔ df['col1'].corr(df['col2'])
What is the purpose of the `matplotlib` library in Python?
✔✔ To create static, animated, and interactive visualizations
What does the `seaborn` library provide in Python?
✔✔ A higher-level interface for creating attractive and informative statistical graphics
What is the difference between a for loop and a list comprehension in Python?
✔✔ A for loop iterates over items in a sequence, while list comprehension is a concise way to
create lists based on existing data
3