阅读并运行代码,完成问题: clear;clc; Gender = ["male";"female";"male";"female";"male"]; Smoker = logical([1;0;1;0;0]); Weight = [176;163;131;133;119]; T = table(Gender,Smoker,Weight); %按性别和吸烟状况分组,计算平均体重 G = groupsummary(T,{'Gender','Smoker'},'mean','Weight') 则男性吸烟的平均体重为(单位为磅)
举一反三
- 【单选题】生成如下数据框的语句是? weight height gender age 1 80 180 male teen 2 75 170 male teen 3 60 165 female adult 4 52 150 female adult A. X ,gender=c("male", "male", "female", "female"),age=c("teen","teen","adult","adult")) B. X ,gender=c("male", "male", "female", "female"),age=c("teen","teen","adult","adult")) C. X ,gender=c(male, male, female, female),age=c(teen,teen,adult,adult)) D. X ,gender=c("male", "male", "female", "female"),age=c("teen","teen","adult","adult"))
- 人们一般用 “gender”来表示生理性别, 或 male 或 female
- 人们一般用“gender”来表示生理性别,或male或female
- On a resume, the correct information about gender is ( ). A: Female B: Man C: Woman D: Male
- import java.io.*; class Person{ public void print(){System.out.print("Person ");} public void printMyGender(String s){ this.print(); System.out.print(s+" "); } } class Gender{ String type="gender"; public void print(Person p){p.printMyGender(type);} } class Female extends Gender{ public Female(){ type="female"; } } class Male extends Gender{ public Male(){ type="male"; } } class Employee extends Person{ public void print(){ System.out.print("Employee ");} } class Manager extends Employee{ public void print(){ System.out.print("Manager ");} } public class Test{ public static void main(String[] args){ Manager man = new Manager(); Employee em = new Employee(); Gender gender1 = new Male(); Gender gender2 = new Female(); gender1.print(man); gender2.print(em); } } 对于以上代码,其运行结果是