尝试使用此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) 我试图弄清楚如何使用Locindexer对象来选择数据帧的子集.
例如
var = df.loc(df['rating'] == 4)
返回为
pandas.core.indexing._LocIndexer
如何使用LocIndexer选择数据帧的子集?