小编Lia*_*eri的帖子

Boto3中的异常 - botocore.exceptions.EndpointConnectionError

尝试使用此python代码连接到数据库以测试连接时.

import boto3
s3 = boto3.resource('s3')

for b in s3.buckets.all():
   print b.name
Run Code Online (Sandbox Code Playgroud)

我收到了这个错误.

Traceback (most recent call last):
  File "boto3_test.py", line 4, in <module>
    for b in s3.buckets.all():
  File "/usr/local/lib/python2.7/dist-packages/boto3/resources/collection.py", line 83, in __iter__
    for page in self.pages():
  File "/usr/local/lib/python2.7/dist-packages/boto3/resources/collection.py", line 161, in pages
    pages = [getattr(client, self._py_operation_name)(**params)]
  File "/usr/local/lib/python2.7/dist-packages/botocore/client.py", line 310, in _api_call
    return self._make_api_call(operation_name, kwargs)
  File "/usr/local/lib/python2.7/dist-packages/botocore/client.py", line 385, in _make_api_call
    operation_model, request_dict)
  File "/usr/local/lib/python2.7/dist-packages/botocore/endpoint.py", line 111, in make_request
    return self._send_request(request_dict, operation_model)
  File "/usr/local/lib/python2.7/dist-packages/botocore/endpoint.py", line 140, in _send_request …
Run Code Online (Sandbox Code Playgroud)

python amazon-web-services boto3

9
推荐指数
1
解决办法
2万
查看次数

熊猫:如何使用LocIndexer?

我试图弄清楚如何使用Locindexer对象来选择数据帧的子集.

例如

var = df.loc(df['rating'] == 4)

返回为

pandas.core.indexing._LocIndexer

如何使用LocIndexer选择数据帧的子集?

python pandas

8
推荐指数
1
解决办法
4828
查看次数

标签 统计

python ×2

amazon-web-services ×1

boto3 ×1

pandas ×1