Skip to content

janeite完成 DL102 入学任务啦 #92

Description

@janeite

环境

  • 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

Activity

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions