Python Pandas اسئلة واجوبة المقابلات
سؤال 41. What is the purpose of the crosstab() function in Pandas?
crosstab() computes a simple cross-tabulation of two (or more) factors.
Example:
pd.crosstab(df['factor1'], df['factor2'])
هل هذا مفيد؟
اضف تعليقا
عرض التعليقات
سؤال 42. How do you apply a custom function to each element in a Pandas DataFrame?
Use the applymap() function. df.applymap(my_function)
هل هذا مفيد؟
اضف تعليقا
عرض التعليقات
سؤال 43. Explain the concept of method chaining in Pandas.
Method chaining is a way of applying multiple operations on a DataFrame in a single line of code.
Example:
df.dropna().mean()
هل هذا مفيد؟
اضف تعليقا
عرض التعليقات
سؤال 44. What is the purpose of the pipe() function in Pandas?
pipe() is used to apply a function to a DataFrame using method chaining.
Example:
df.pipe(my_function).dropna()
هل هذا مفيد؟
اضف تعليقا
عرض التعليقات
سؤال 45. How can you create a Pandas DataFrame from a dictionary of Series or dictionaries?
Use the pd.DataFrame() constructor. df = pd.DataFrame({'column1': series1, 'column2': series2})
هل هذا مفيد؟
اضف تعليقا
عرض التعليقات
الاكثر فائدة حسب تقييم المستخدمين:
- 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?