Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

janeite完成 DL102 入学任务啦 #92

Open
janeite opened this issue Oct 5, 2017 · 0 comments
Open

janeite完成 DL102 入学任务啦 #92

janeite opened this issue Oct 5, 2017 · 0 comments

Comments

@janeite
Copy link

janeite commented Oct 5, 2017

环境

  • Mac OSx
  • python 3

基础任务

文本中已有空格分隔单词,所以先用空格为分隔符将文本切割为单词词库,再将相邻单词组合生成二元词组词库,统计二元词组词库的词频即可。

  • 运行结果

2017-10-06 7 36 14

  • 遇到 问题

  1. 最初在中文显示为乱码的问题上花费了大量时间,最后将python2改为python3才解决乱码问题;
  2. 不熟悉python,调试代码也很花时间,需要多敲代码多读文档尽快熟悉起来;
  3. 曾试图用re.match正则匹配所有汉字,失败,后改用剔除标点符号的方式。

进阶任务

  1. 求导

2017-10-06 8 38 05

  1. 向量化

  • 概念理解

用矩阵计算来代替循环嵌套,可以让代码简洁。

原数组
2017-10-06 9 21 57
去负值后的数组
2017-10-06 9 22 02

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants