Pandas 面接の質問と回答
質問 6. How to drop a column in a DataFrame?
You can drop a column using the drop() method: df.drop('ColumnName', axis=1, inplace=True)
役に立ちましたか?
コメントを追加
コメントを見る
質問 7. Explain the use of groupby() in Pandas.
groupby() is used to group DataFrame by a column and perform aggregate functions.
Example:
df.groupby('Column').mean()
役に立ちましたか?
コメントを追加
コメントを見る
質問 8. What is the purpose of the apply() function in Pandas?
apply() is used to apply a function along the axis of a DataFrame.
Example:
df['Column'].apply(lambda x: x*2)
役に立ちましたか?
コメントを追加
コメントを見る
質問 9. Explain the use of merge() in Pandas.
merge() is used to combine two DataFrames based on a common column.
Example:
pd.merge(df1, df2, on='common_column')
役に立ちましたか?
コメントを追加
コメントを見る
質問 10. How to handle missing values in a DataFrame?
You can use methods like dropna() to remove missing values or fillna() to fill them with a specific value.
Example:
df.dropna() or df.fillna(value)
役に立ちましたか?
コメントを追加
コメントを見る
ユーザー評価で最も役立つ内容: