自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(12)
  • 收藏
  • 关注

原创 简易英文问答系统(glove.6B词向量)

1.读入json文件转换成dict形式`# doc = open('train-v2.0.json').readlines()此时格式为list,需要转换格式成dictimport jsonf = open('train1-v2.0.json')doc = json.load(f)# 利用json.load()将list形式转换成dict的形式2.将全部问题和答案放入question...

2020-05-03 17:03:29 2152 1

原创 读取excel文件并绘图

pip install pandasLooking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/Note: you may need to restart the kernel to use updated packages.Requirement already satisfied: pandas in c:\users\zcc\appdata\local\programs\python\python37\lib\site-packag

2020-05-21 22:55:59 894 1

原创 利用pandas来进行csv文件读取

read_csv:从文件,url,文件型对象中加载带分隔符的数据,默认分隔符为逗号read_table:从文件,url,文件型对象中加载带分隔符的数据,默认分隔符为制表符’/t’read_fwf:读取固定宽度的数据read_clipboard:读取剪切板中的数据,可以看作是read_table的剪切板,在将在网页上的数据转换为表格中的数据时用到pip install pandasLooking in indexes: https://pypi.tuna.tsinghua.edu.cn/simpl

2020-05-21 20:28:34 793

原创 DataFrame的层次化索引访问及汇总运算

pip install pandasLooking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/Note: you may need to restart the kernel to use updated packages.WARNING: You are using pip version 20.0.2; however, version 20.1.1 is available.You should consider upgrad

2020-05-21 15:43:17 682

原创 pandas的层次化索引

层次化索引时pandas的一项比较重要的功能,可以在一个轴上拥有多个索引级别。另一种说法时可以以低纬度的形式处理高维度数据pip install pandasLooking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/Note: you may need to restart the kernel to use updated packages.WARNING: You are using pip version 20.0.2; ho

2020-05-21 14:22:02 255

原创 DataFrame和Series之间的运算和排序

DataFrame和Series之间的运算pip install pandasLooking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/Note: you may need to restart the kernel to use updated packages.Requirement already satisfied: pandas in c:\users\zcc\appdata\local\programs\python\py

2020-05-21 12:35:02 371

原创 pandas的重新索引,算数运算和数据对齐

pip install pandasLooking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/Note: you may need to restart the kernel to use updated packages.Requirement already satisfied: pandas in c:\users\zcc\appdata\local\programs\python\python37\lib\site-package

2020-05-21 11:09:36 232

原创 pandas数据类型简介

pip install pandasNote: you may need to restart the kernel to use updated packages.Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple/Requirement already satisfied: pandas in c:\users\zcc\appdata\local\programs\python\python37\lib\site-packag

2020-05-20 17:44:35 924

原创 viterbi算法实现词性标注

word2id,id2word ={},{}tag2id,id2tag = {},{}with open('word_tagging_traindata.txt') as training_data: for line in training_data.readlines(): line = line.rstrip().split('/') word,tag = line[0],line[1] for letters in word.rstrip(

2020-05-20 15:06:28 361

原创 简易英文问答系统(glove2word2vec)

利用gensim模块中的glove2word2vec来将glove词向量转化成另一个文件里的glove2word2vec向量,方便以后备用from gensim.test.utils import datapath,get_tmpfilefrom gensim.scripts.glove2word2vec import glove2word2vecglove_file = datapath(...

2020-05-03 23:05:04 969

原创 关于如何使用glove词向量

glove词向量为utf-8格式编码文件,python3中以gbk编码格式读入会出错:`glove = open('glove.6B.100d.txt', 'r')word = list()word_vector = list()line = glove.readline() #一行一行的读取,返回strwhile line: line = list(line.split())...

2020-05-03 21:24:36 2723

原创 python中read(),readline(),和readlines()区别

一、read([size])方法read([size])方法从文件当前位置起读取size个字节,若无参数size,则表示读取至文件结束为止,它返回为字符串对象二、readline()方法从字面意思可以看出,该方法每次读出一行内容,所以,读取时占用内存小,比较适合大文件,该方法返回一个字符串对象。三、readlines()方法读取整个文件所有行,保存在一个列表(list)变量中,每行作为一个...

2020-05-02 14:16:30 246

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除