提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
前言
提示:这里可以添加本文要记录的大概内容:
例如:随着人工智能的不断发展,机器学习这门技术也越来越重要,很多人都开启了学习机器学习,本文就介绍了机器学习的基础内容。
提示:以下是本篇文章正文内容,下面案例可供参考
一、proj2
示例:pandas 是基于NumPy 的一种工具,该工具是为了解决数据分析任务而创建的。
二、使用步骤
1.引入库
代码如下(示例):
package proj2;
public class student {
int id;
String name;
int age;
double mathScore;
double chineseScore;
public student(int id,String name,int age,double mathScore,double chineseScore) {
this.id = id;
this.name = name;
this.age = age;
this.mathScore = mathScore;
this.chineseScore = chineseScore;
}
//计算学生总成绩
public double totalScore() {
return this.mathScore + this.chineseScore;
}
//展示学生的所有信息
public void showinfo() {
System.out.println("学号"+ this.id);
System.out.println("姓名"+ this.name);
System.out.println("年龄"+ this.age);
System.out.println("数学成绩"+ this.mathScore);
System.out.println("语文成绩"+ this.chineseScore);
System.out.println("总成绩"+this.totalScore());
}
}
2.读入数据
代码如下(示例):
package proj2;
public class teststudent {
public static void main(String[] args) {
student stu1 = new student(1,"张三",23,90,87);
stu1.showinfo();
student stu2 = new student(2,"李四",24,66,88);
stu2.showinfo();
}
}
总结
提示:这里对文章进行总结:
例如:以上就是今天要讲的内容,本文仅仅简单介绍了pandas的使用,而pandas提供了大量能使我们快速便捷地处理数据的函数和方法。