首页 > 解决方案 > 如何解决“无效的'休息'数量”

问题描述

我需要帮助来解决此错误。我正在尝试创建 df_custdata 文件的直方图,然后提取一个数字列并将其放入自己的直方图中。

代码:

df_custdata <- gsub(".", "", df_custdata)  
df_custdata <- as.numeric(df_custdata) 
hist(df_custdata)

错误: hist.default(f_custdata) 中的错误:“中断”数无效

标签: r

解决方案


在 Python 中,缩进非常重要,冒号也是如此。

为此,您还需要使用 if 语句而不是 for 循环。

此代码有效,

age = int(input("Enter You Age:"))

if age in range (14,18):
    print ("This student is in Highschool")
else:
    print ("This student is not in Highschool")

推荐阅读