Python Pandas اسئلة واجوبة المقابلات
سؤال 46. Explain the purpose of the stack() and unstack() functions in Pandas.
stack() is used to pivot the columns of a DataFrame to the rows. unstack() does the reverse operation.
Example:
df.stack()
هل هذا مفيد؟
اضف تعليقا
عرض التعليقات
سؤال 47. What is the purpose of the to_excel() function in Pandas?
to_excel() is used to write a DataFrame to an Excel file.
Example:
df.to_excel('output.xlsx', index=False)
هل هذا مفيد؟
اضف تعليقا
عرض التعليقات
سؤال 48. How do you calculate the correlation matrix for a Pandas DataFrame?
Use the corr() function. df.corr()
هل هذا مفيد؟
اضف تعليقا
عرض التعليقات
الاكثر فائدة حسب تقييم المستخدمين:
- 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?