Pandas اسئلة واجوبة المقابلات
سؤال 26. How to calculate correlation between columns in a DataFrame?
You can use the corr() method: df.corr()
هل هذا مفيد؟
اضف تعليقا
عرض التعليقات
سؤال 27. Explain the purpose of the cut() function in Pandas.
cut() is used to segment and sort data values into bins.
Example:
pd.cut(df['Values'], bins=[0, 10, 20, 30], labels=['<10', '10-20', '20-30'])
هل هذا مفيد؟
اضف تعليقا
عرض التعليقات
سؤال 28. What is the use of the nlargest() function in Pandas?
nlargest() returns the first n largest elements from a series or DataFrame.
Example:
df['Column'].nlargest(5)
هل هذا مفيد؟
اضف تعليقا
عرض التعليقات
سؤال 29. How to convert a Pandas DataFrame to a NumPy array?
You can use the values attribute: df.values
هل هذا مفيد؟
اضف تعليقا
عرض التعليقات
سؤال 30. Explain the purpose of the get_dummies() function in Pandas.
get_dummies() is used for one-hot encoding categorical variables.
Example:
pd.get_dummies(df['Category'])
هل هذا مفيد؟
اضف تعليقا
عرض التعليقات
الاكثر فائدة حسب تقييم المستخدمين: