题目
ISBA2401 - Data Analytics with Python (MW 05:45 PM, MW 7:35 PM, TTh 7:35PM) Midterm Multiple Choice (FA2025 - MW735) - Requires Respondus LockDown Browser
单项选择题
Q12 I ran df.corr() and received an error (assuming I am in pandas 2). What's the most likely cause?
选项
A.The DataFrame has missing values
B.The DataFrame has string/object columns and corr() tried to include them as the default is numeric_only = False
C.The DataFrame has duplicated column names
D.A column has non-scalar objects (list/dictionary)
查看解析
标准答案
Please login to view
思路分析
Reasserting the scenario: the user ran df.corr() in pandas 2 and an error occurred. We will evaluate each potential cause to understand why the error happened.
Option 1: The DataFrame has missing values. While missing values can affect certain computations, corr() typically handles missing data by pairwise deletion or other internal strategies, and missing values alone are unlikely to cause a hard error just from calling corr(). In many cases, missing values are simply ignored or result in NaN in the correlation results, not a crash or error message. Therefore this reason is no......Login to view full explanation登录即可查看完整答案
我们收录了全球超50000道考试原题与详细解析,现在登录,立即获得答案。
类似问题
In pandas, which function is used to calculate the correlation between columns in DataFrame df?
In a consumer society, many adults channel creativity into buying things
Economic stress and unpredictable times have resulted in a booming industry for self-help products
People born without creativity never can develop it
更多留学生实用工具
希望你的学习变得更简单
加入我们,立即解锁 海量真题 与 独家解析,让复习快人一步!