![](/img/trans.png)
[英]reading data from s3 by jupyter notebook in ubuntu ec2 deep learning instance
[英]AWS Jupyter Notebook EC2 Instance: Getting error while reading pandas csv from S3
从S3读取CSV时,内核将重新启动,并弹出以下信息:
Kernel Restarting
The kernel appears to have died. It will restart automatically
下面是代码片段:
import boto3
import pandas as pd
from boto.s3.connection import S3Connection
YOUR_ACCESS_KEY='******'
YOUR_SECRET_KEY='******'
YOUR_BUCKET='******'
client = boto3.client('s3',aws_access_key_id=YOUR_ACCESS_KEY, aws_secret_access_key=YOUR_SECRET_KEY)
client.download_file(YOUR_BUCKET, 'test.csv','test.csv')
从以下行引发错误:
test_df = pd.read_csv('test.csv')
但是我可以访问其他文件,例如示例文本文件:
client.download_file(YOUR_BUCKET, 'sample.txt','sample.txt')
print(open('sample.txt').read())
我认为此错误是由于CSV文件的大小所致,但是读取5MB CSV文件会产生相同的错误。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.