Python Pandas اسئلة واجوبة المقابلات
سؤال 11. How can you apply a function to each element in a DataFrame?
Use the apply function. df.apply(my_function)
هل هذا مفيد؟
اضف تعليقا
عرض التعليقات
سؤال 12. What is the purpose of the melt function in Pandas?
melt is used to transform wide-format data to long-format data.
Example:
pd.melt(df, id_vars=['id_column'], value_vars=['value_column'])
هل هذا مفيد؟
اضف تعليقا
عرض التعليقات
سؤال 13. Explain the concept of broadcasting in Pandas.
Broadcasting is the ability of NumPy and Pandas to perform operations on arrays or DataFrames of different shapes.
هل هذا مفيد؟
اضف تعليقا
عرض التعليقات
سؤال 14. How can you rename columns in a Pandas DataFrame?
Use the rename function. df.rename(columns={'old_name': 'new_name'})
هل هذا مفيد؟
اضف تعليقا
عرض التعليقات
سؤال 15. What is the purpose of the concat function in Pandas?
concat is used to concatenate DataFrames along a particular axis.
Example:
pd.concat([df1, df2], axis=1)
هل هذا مفيد؟
اضف تعليقا
عرض التعليقات
الاكثر فائدة حسب تقييم المستخدمين:
- What is Pandas in Python?
- How do you select specific columns from a DataFrame?
- How do you import the Pandas library?
- How can you apply a function to each element in a DataFrame?
- How can you rename columns in a Pandas DataFrame?