我们正在搜索缺失值的列的名称

时间:2018-06-15 12:56:53

标签: median

搜索缺失值?

columns = ['median', 'p25th', 'p75th']

# Look at the dtypes of the columns
print(____)

# Find how missing values are represented (Search for missing values in the median, p25th, and p75th columns.)
print(recent_grads["median"].____)

# Replace missing values with NaN,using numpy's np.nan.
for column in ___:
    recent_grads.loc[____ == '____', column] = ____?

3 个答案:

答案 0 :(得分:1)

正确答案是-

for column in columns:
  recent_grads.loc[recent_grads[column] == 'UN', column] = np.nan

答案 1 :(得分:0)

x = np.random.rand(44)
y = np.random.rand(40)
d1, inx1 = fastdtw(y, x)
d2, inx2= fastdtw(y, x)
d1, d2

答案 2 :(得分:0)

我们要搜索缺失值的列的名称

columns = ['median', 'p25th', 'p75th']

看看dtypes

print(recent_grads[columns].dtypes)

查找缺失值的表示方式

print(recent_grads["median"].unique())

用NaN替换缺失值

for column in columns:
    recent_grads.loc[recent_grads[column] == 'UN', column] = np.nan