python - 将 AWS Glue Python 与 NumPy 和 Pandas Python 程序包结合使用

标签 python pandas amazon-web-services aws-lambda aws-glue

在 AWS 上名为 Glue 的新 ETL 工具中使用 NumPy 和 Pandas 等包的最简单方法是什么?我在 Python 中有一个完整的脚本,我想在利用 NumPy 和 Pandas 的 AWS Glue 中运行。

最佳答案

您可以检查使用此脚本作为粘合作业安装的最新 python 包

import logging
import pip
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)

if __name__ == '__main__':
    logger.info(pip._internal.main(['list']))

截至 2020 年 6 月 30 日 Glue as 已预安装这些 python 包。所以 numpypandas 都被涵盖了。

awscli 1.16.242
boto3 1.9.203
botocore 1.12.232
certifi 2020.4.5.1
chardet 3.0.4
colorama 0.3.9
docutils 0.15.2
idna 2.8
jmespath 0.9.4
numpy 1.16.2
pandas 0.24.2
pip 20.0.2
pyasn1 0.4.8
PyGreSQL 5.0.6
python-dateutil 2.8.1
pytz 2019.3
PyYAML 5.2
requests 2.22.0
rsa 3.4.2
s3transfer 0.2.1
scikit-learn 0.20.3
scipy 1.2.1
setuptools 45.1.0
six 1.14.0
urllib3 1.25.8
virtualenv 16.7.9
wheel 0.34.2

如果它们存在于用于构建附加 .whlrequirements.txt 中,您可以在 glue-python 中安装其他包。 whl 文件在您的脚本启动之前被收集并安装。我还建议您查看 Sagemaker Processing,这对于基于 python 的作业来说更容易。与 glue-python shell 的无服务器实例不同,您在那里不限于 16gb 的限制。

关于python - 将 AWS Glue Python 与 NumPy 和 Pandas Python 程序包结合使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46329561/

相关文章:

java - Jenkins 命令显示目录中的所有文件?

python - 无法从线程显示窗口

python - CSV 文件创建问题

python - Pandas 元组 groupby 聚合

performance - 在效率方面,GetItem/BatchGetItem 与查询和扫描 DynamoDB 表相比如何?

python - OpenCV 找到正确的阈值来确定图像匹配与否与匹配分数

python - 将日期+小时转换为时间戳 - pandas/python

python - 在 Pandas 数据框的每一行中查找第一个和最后一个非零列

linux - 以 apache 所有者身份授予文件夹权限

spring - 无法将 AWS-Postgres 服务器与带有 heroku 托管的 spring boot 应用程序连接起来