摘要: 1. 读取数据集 使用pandas读取训练数据集。 import re import pandas as pd import numpy as np from bs4 import BeautifulSoup from sklearn.feature_extraction.text import C 阅读全文
posted @ 2022-02-22 16:08 刷书狂魔 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 问题: 假设现在有一个字典: dic = {1:1, 2:2} 直接访问会报错: dic.keys()[0] dic.values()[0] 报错 TypeError: 'dict_values' object does not support indexing 解决方法: 先将dict_value 阅读全文
posted @ 2022-02-21 20:19 刷书狂魔 阅读(57) 评论(0) 推荐(0) 编辑
摘要: '%matplotlib inline'是一个Ipython的魔法函数,其作用是在使用matplotlib画图时可以省略'plt.show()',直接显示图像。 阅读全文
posted @ 2022-02-14 21:37 刷书狂魔 阅读(317) 评论(0) 推荐(0) 编辑
摘要: 1. Overview 要为xv6添加一个系统调用,需要修改以下5个文件: syscall.h syscall.c sysproc.c usys.S user.h 由于Unix v6发行于1975年,下面我们以添加一个返回整数1975的系统调用作为示范来说明如何为xv6添加一个系统调用。 2. sy 阅读全文
posted @ 2022-01-26 17:34 刷书狂魔 阅读(923) 评论(0) 推荐(0) 编辑
摘要: 编写代码 创建一个名为hello.c的文件: // 该程序将向屏幕输出一句hello #include "types.h" #include "user.h" int main(int argc, char *argv[]) { printf(1, "hello, my name is '%s'.\ 阅读全文
posted @ 2022-01-26 14:49 刷书狂魔 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 1. 下载xv6 从github上拉取xv6的源码: $ git clone git://github.com/mit-pdos/xv6-public.git 2. 下载qemu 在Ubuntu下使用apt-get,其他发行版自行搜索如何下载: $ sudo apt-get install qemu 阅读全文
posted @ 2022-01-26 12:14 刷书狂魔 阅读(780) 评论(1) 推荐(0) 编辑
摘要: 当前文件夹: t.ipython test.py test.py: print("Hello, SageMaker studio lab!") 在Jupyter Lab中运行.py文件有两种方法 1. 将文件导入ipython的cell中 示例代码: %load test.py 运行结果: 2. 直 阅读全文
posted @ 2022-01-04 14:06 刷书狂魔 阅读(1858) 评论(0) 推荐(0) 编辑
摘要: 1. 导入MNIST数据集 from keras.datasets import mnist (train_images, train_labels), (test_images, test_labels) = mnist.load_data() train_images.shape (60000, 阅读全文
posted @ 2022-01-01 19:21 刷书狂魔 阅读(41) 评论(0) 推荐(0) 编辑
摘要: 数组 特点: 在一段连续的内存空间中存放相同的数据类型的数据,可随机访问。 1. 定义 // 1. 数据类型 数组名[ 数组长度 ] int array[5]; array[0] = 10; array[1] = 20; array[2] = 30; array[3] = 40; array[4] 阅读全文
posted @ 2021-12-29 23:37 刷书狂魔 阅读(52) 评论(0) 推荐(0) 编辑
摘要: 程序流程结构 C/C++支持最基本的三种程序运行结构: 顺序结构:程序按行顺序执行,不发生跳转 选择结构:依据条件是否被满足,有选择地执行相应的功能 循环结构:依据条件是否被满足,多次循环执行某段代码 1. 选择结构 1.1 if 语句 作用:执行满足条件的代码段 if的三种形式: 单行格式if语句 阅读全文
posted @ 2021-12-28 23:01 刷书狂魔 阅读(44) 评论(0) 推荐(0) 编辑
总访问: counter for blog 次