下载APP
登录
关闭
讲堂
算法训练营
Python 进阶训练营
企业服务
极客商城
客户端下载
兑换中心
渠道合作
推荐作者
当前播放: 51 | 机器学习的一般流程与NumPy安装
00:00 / 00:00
标清
  • 标清
1.0x
  • 2.0x
  • 1.5x
  • 1.25x
  • 1.0x
  • 0.5x
网页全屏
全屏
00:00
付费课程,可试看

零基础学Python

共71讲 · 71课时·约540分钟
16024
免费
01 | Python语言的特点
免费
02 | Python的发展历史与版本
免费
03 | Python的安装
免费
04 | Python程序的书写规则
免费
05 | 基础数据类型
免费
06 | 变量的定义和常用操作
07 | 序列的概念
08 | 字符串的定义和使用
09 | 字符串的常用操作
10 | 元组的定义和常用操作
11 | 列表的定义和常用操作
12 | 条件语句
13 | for循环
14 | while循环
15 | for循环语句中的if嵌套
16 | while循环语句中的if嵌套
17 | 字典的定义和常用操作
18 | 列表推导式与字典推导式
19 | 文件的内建函数
20 | 文件的常用操作
21 | 异常的检测和处理
22 | 函数的定义和常用操作
23 | 函数的可变长参数
24 | 函数的变量作用域
25 | 函数的迭代器与生成器
26 | Lambda表达式
27 | Python内建函数
28 | 闭包的定义
29 | 闭包的使用
30 | 装饰器的定义
31 | 装饰器的使用
32 | 自定义上下文管理器
33 | 模块的定义
34 | PEP8编码规范
35 | 类与实例
36 | 如何增加类的属性和方法
37 | 类的继承
38 | 类的使用-自定义with语句
39 | 多线程编程的定义
40 | 经典的生产者和消费者问题
41 | Python标准库的定义
42 | 正则表达式库re
43 | 正则表达式的元字符
44 | 正则表达式分组功能实例
45 | 正则表达式库函数match与s...
46 | 正则表达式库替换函数sub...
47 | 日期与时间函数库
48 | 数学相关库
49 | 使用命令行对文件和文件夹...
50 | 文件与目录操作库
51 | 机器学习的一般流程与NumP...
52 | NumPy的数组与数据类型
53 | NumPy数组和标量的计算
54 | NumPy数组的索引和切片
55 | pandas安装与Series结构
56 | Series的基本操作
57 | Dataframe的基本操作
58 | 层次化索引
59 | Matplotlib的安装与绘图
60 | 机器学习分类的原理
61 | Tensorflow的安装
62 | 根据特征值分类的模型和代...
63 | 网页数据的采集与urllib库
64 | 网页常见的两种请求方式ge...
65 | HTTP头部信息的模拟
66 | requests库的基本使用
67 | 结合正则表达式爬取图片链...
68 | Beautiful Soup的安装和...
69 | 使用爬虫爬取新闻网站
70 | 使用爬虫爬取图片链接并下...
71 | 如何分析源代码并设计合理...
本节摘要

课程源码、课件及课后作业地址:

https://github.com/wilsonyin123/geekbangpython

精选留言(9)

  • 我是mac,那numpy的安装包下载包有区别吗?

    作者回复: 没有区别的whl格式是pip封装的和平台无关

    1
  • 2018-08-09
    老师 为什么我的numpy安装不了 pip3显示如下:
    bogon:~ Jason$ sudo pip3 install numpy
    Password:
    The directory '/Users/Jason/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
    The directory '/Users/Jason/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
    Collecting numpy
      Downloading https://files.pythonhosted.org/packages/6a/d5/218414f0f41cb3f183d55d68dbcd996fa3602d5849bdf2ad6c059e98fa68/numpy-1.15.0-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (24.5MB)
        2% |▊ | 532kB 8.0kB/s eta 0:49:43Exception:
    Traceback (most recent call last):
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py", line 331, in _error_catcher
        yield
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py", line 413, in read
        data = self._fp.read(amt)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 62, in read
        data = self.__fp.read(amt)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 449, in read
        n = self.readinto(b)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 493, in readinto
        n = self.fp.readinto(b)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socket.py", line 586, in readinto
        return self._sock.recv_into(b)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 1009, in recv_into
        return se
    展开
    1
  • 2019-10-11
    老师,MAC 系统,使用 pip3 install numpy 命令报错,使用 pip install numpy 命令正常,这是什么原因呢?是因为默认就是 python 3 吗?谢谢。

    作者回复: 你好,在linux 中 pip 如果是用rpm 安装,会产生 pip3 pip3.6和 pip 三个文件(当然一个是真正的命令,其他两个是快捷方式),在mac 中,如果程序没自动创建就没办法执行了,如果你使用pip比较习惯也可以手动创建

    which pip <---找到pip命令的完整路径在哪里
    ln -s /完整路径/pip /完整路径/pip3 <---创建个快捷方式即可

    另外,一般mac系统只有pip3 没有pip命令,这种情况可能是使用了一些软件工具安装,并非官方安装包

  • 2019-08-20
    mac 安装失败之后的解决办法:
    1 python get-pip.py --user
    2 pip3 install numpy --user
    为什么好用不知道,不熟悉cmdl
  • 2019-07-12
    win10中安装不了numpy
    D:\untitled\1\Scripts>pip stall numpy
    Fatal Python error: Py_Initialize: unable to load the file system codec
    ModuleNotFoundError: No module named 'encodings'

    Current thread 0x00000d28 (most recent call first):


    这样也不行
    D:\untitled\1\Scripts>pip install numpy-1.16.4-cp36-cp36m-win_amd64.whl
    Fatal Python error: Py_Initialize: unable to load the file system codec
    ModuleNotFoundError: No module named 'encodings'

    Current thread 0x00000c20 (most recent call first):

    展开

    作者回复: 使用 pip install numpy-1.16.4-cp36-cp36m-win_amd64.whl 这种方式安装,第一种方式需要安装编译器,比较麻烦
    另外错误提示encodings 也要用pip先安装上, 使用pip install encodings 看看提示什么错误,根据错误来排查一下原因

    1
  • 2019-06-27
    老师,安装不了啊,报错(Windows的):
    Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)] on win32
    pip3 install numpy
      File "<input>", line 1
        pip3 install numpy
                   ^
    SyntaxError: invalid syntax
    展开

    作者回复: pip3 install numpy 要在终端执行, 不要再python提示符下运行,它是一条类似 ping、 python 这类的命令,不是python 的函数

  • 2019-03-17
    老师好,我的import numpy
    python 异常退出
    显示 process finished with exit code 139 (interrupted by signal 11:SIGSEGV)

    作者回复: free() close() 多次和引用空指针都会导致SIGSEGV ,建议你使用pip 重新安装 numpy

  • Collecting numpy
      Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x108120da0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known')': /simple/numpy/
      Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x108120cc0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known')': /simple/numpy/
      Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x108120a58>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known')': /simple/numpy/
      Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x108120a20>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known')': /simple/numpy/
      Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x1081206a0>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known')': /simple/numpy/
      Could not find a version that satisfies the requirement numpy (from versions: )
    No matching distribution found for numpy
    老师,不知道这是什么原因
    展开

    作者回复: 网络原因导致安装包在线安装失败,可以通过搜索引擎找numpy的离线安装包,下载下来的格式是whl扩展名的,打开命令行,使用pip加完整路径安装,如:
    pip install /path/to/install/numpy-version-cp36-platform.whl

  • 2018-08-09
    出现问题了,安装不了numpy,如下:
    bogon:~ Jason$ sudo pip3 install numpy
    Password:
    The directory '/Users/Jason/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
    The directory '/Users/Jason/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
    Collecting numpy
      Downloading https://files.pythonhosted.org/packages/6a/d5/218414f0f41cb3f183d55d68dbcd996fa3602d5849bdf2ad6c059e98fa68/numpy-1.15.0-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (24.5MB)
        2% |▊ | 532kB 8.0kB/s eta 0:49:43Exception:
    Traceback (most recent call last):
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py", line 331, in _error_catcher
        yield
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/urllib3/response.py", line 413, in read
        data = self._fp.read(amt)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/pip/_vendor/cachecontrol/filewrapper.py", line 62, in read
        data = self.__fp.read(amt)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 449, in read
        n = self.readinto(b)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 493, in readinto
        n = self.fp.readinto(b)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socket.py", line 586, in readinto
        return self._sock.recv_into(b)
      File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 1009, in recv_into
        return self.read(
    展开

    作者回复: 更新pip,然后将numpy的whl安装包下载到本地安装,很多软件源在国外,网络不稳定会导致安装失败。