在mongo
命令行中,我可以运行
db.my_collection.stats()
Run Code Online (Sandbox Code Playgroud)
我需要获取我的收藏统计数据,Python
所以我试过了
from pymongo import MongoClient
client = MongoClient()
db = client.test_database
collection = db.test_collection
collection.stats()
Run Code Online (Sandbox Code Playgroud)
但我明白了
TypeError: 'Collection' object is not callable.
If you meant to call the 'stats' method on a 'Collection' object it is failing because no such method exists.
Run Code Online (Sandbox Code Playgroud)
这是因为pymongo
不支持这种方法.如何发送原材料mongoDB
到命令mongo
通过Python
?
在Django第一个应用程序的Django教程中,我们有
from django.http import HttpResponse
def index(request):
return HttpResponse("Hello, world. You're at the polls index.")
Run Code Online (Sandbox Code Playgroud)
然后urls.py有
from django.conf.urls import url
from polls import views
urlpatterns = [
url(r'^$', views.index, name='index'),
]
Run Code Online (Sandbox Code Playgroud)
现在我的问题是传递给索引函数的“请求”参数是什么,同样在urls.py中调用函数索引时,该参数未传递,而变量仅在该行中称为views.index url(r'^$', views.index, name='index'),
如何x
在 Scipy 中计算多元高斯在某一点的概率?
我试过
probability = multivariate_normal(x, mean, v)
Run Code Online (Sandbox Code Playgroud)
其中x
、mean
、v
都是大小正确的向量,但我得到:
probability = multivariate_normal(x, mean, v )
TypeError: __call__() takes at most 3 arguments (4 given)
Run Code Online (Sandbox Code Playgroud)