热门面试题与答案和在线测试
面向面试准备、在线测试、教程与实战练习的学习平台

通过聚焦学习路径、模拟测试和面试实战内容持续提升技能。

WithoutBook 将分主题面试题、在线练习测试、教程和对比指南整合到一个响应式学习空间中。

面试准备

Pandas 面试题与答案

问题 21. Explain the purpose of the crosstab() function in Pandas.

crosstab() computes a cross-tabulation of two or more factors.

Example:

pd.crosstab(df['Factor1'], df['Factor2'])

这有帮助吗? 添加评论 查看评论
 

问题 22. How to handle categorical data in Pandas?

You can use the astype() method to convert a column to a categorical type: df['Category'] = df['Category'].astype('category')

这有帮助吗? 添加评论 查看评论
 

问题 23. Explain the use of melt() function in Pandas.

melt() is used to reshape or transform data by unpivoting it.

Example:

pd.melt(df, id_vars=['ID'], value_vars=['Var1', 'Var2'])

这有帮助吗? 添加评论 查看评论
 

问题 24. What is the purpose of the to_csv() method in Pandas?

to_csv() is used to write a DataFrame to a CSV file.

Example:

df.to_csv('output.csv', index=False)

这有帮助吗? 添加评论 查看评论
 

问题 25. Explain the use of the nunique() function in Pandas.

nunique() returns the number of unique elements in a column.

Example:

df['Column'].nunique()

这有帮助吗? 添加评论 查看评论
 

用户评价最有帮助的内容:

版权所有 © 2026,WithoutBook。