如何在Windows上安装numpy和pandas [英] how to install numpy and pandas on windows

查看:311
本文介绍了如何在Windows上安装numpy和pandas的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将以我是栈标准编程n00b开头.我具有数据分析和脚本编写的经验-这是我在一家金融公司的专业经验-但我不知道我在后端做什么.

I'll preface by saying I'm a programming n00b by stack standards. I have experience with data analysis and scripting -- this is what I do professionally at a financial firm -- but I have no idea what I'm doing on the back end.

我正尝试开始使用pandas和python ---远离matlab/vba,但我不知道如何安装pandas库.

I'm trying to start using pandas and python --- moving away from matlab/vba but I can't figure out how to install the pandas library.

当我尝试导入熊猫时,我收到一个错误,提示不存在numpy模块.我试图安装ezsetup/pip(不知道这是什么)...我也不知道在哪里输入此命令$ python get-pip.py

When I try to import pandas I get an error that numpy module is not present. I tried to install ezsetup / pip (no idea what this is btw)... and I have no idea where to enter this command$ python get-pip.py

有时候我尝试import pandas时遇到错误,无法导入可哈希的名称表

Sometimes when I try to import pandas I get an error cannot import name table hashable

我不知道这意味着什么,我什么也没得到.

I have no idea what any of this means and I am not getting anywhere.

更新

好吧,我安装了anaconda,它似乎允许我直接从控制台导入numpy和pandas.话虽这么说,当我尝试编写基本的时间序列并使用pandas语法对其进行绘制时,出现一个错误,即未定义序列",因此我不确定它是否确实有效

Ok I installed anaconda and it seems to be allowing me to import numpy and pandas directly from the console. That being said when I try to write a basic time series and plot it using pandas syntax, i get an error that "series is not defined" as such I'm not sure if it is actually working

  In [1]: import matplotlib.pyplot as plt
  In [2]: ts = Series(randn(1000), index=date_range('1/1/2000', periods=1000))
  In [3]: ts = ts.cumsum()
  In [4]: ts.plot()

推荐答案

用于Windows第三方模块的最佳资源是Christoph Gohlke的 python.org 版本的Python一起使用-确保您将获得适合您的版本和体系结构的正确安装程序.

The best resource for third-party modules for Windows is Christoph Gohlke's Python Extension Packages for Windows repository. Each module is available as a self-extracting .exe installer, for use with the python.org version of Python - make sure you get the correct installer for your version and architecture.

NumPy 不需要任何其他软件包, pandas 可以,因此请确保全部使用.安装顺序并不重要.

While NumPy does not require any other packages, pandas does, so make sure you get them all. The installation order is not important.

与Anaconda或Enthought之类的发行版相比,该资源的优势在于Gohlke博士可以使软件包保持最新状态,从而允许您运行模块的最新版本.此外,几乎所有模块都具有多个Python版本,而其他一些发行版仅基于Python 2.7.

The advantages of this resource over a distribution like Anaconda or Enthought is that Dr. Gohlke keeps the packages very up to date, allowing you to run the latest versions of the modules. Additionally, nearly all of the modules have multiple Python versions, while some of the other distributions are only based on Python 2.7.

缺点是您需要单独安装每个软件包,并且没有用于管理依赖项的软件包管理器.

The disadvantage is that you need to install each package individually, and there is no package manager for handling dependencies.

这篇关于如何在Windows上安装numpy和pandas的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆