小编smi*_*ffs的帖子

pylab.hist(data,normed = 1).规范化似乎不正确

我正在尝试使用参数normed = 1创建直方图

例如:

import pylab

data = ([1,1,2,3,3,3,3,3,4,5.1])    
pylab.hist(data, normed=1)
pylab.show()
Run Code Online (Sandbox Code Playgroud)

我预计这些垃圾箱的总和将是1.但是,其中一个垃圾箱大于1.这个标准化做了什么?如何创建一个直方图,直方图的积分等于1?

在此输入图像描述

python numpy graph matplotlib

42
推荐指数
5
解决办法
9万
查看次数

如何优化SQLite索引?

我有一个表t1和两个索引:

create index if not exists timeindex on t1(time, "Bytes Received")
create index if not exists filenameindex on t1(filename)
Run Code Online (Sandbox Code Playgroud)

下一个查询执行得足够快:

select "Bytes Received" from t1 where time>="11:19:31.18" and time <= "11:19:36.18"
Run Code Online (Sandbox Code Playgroud)

但是当我向WHERE语句添加一个附加条件时,查询会大大减慢

select "Bytes Received" 
    from t1 
    where time>="11:19:31.18" and time <= "11:19:36.18"
    and filename = "SE12.log"
Run Code Online (Sandbox Code Playgroud)

我试图创建一个新索引,t1(time, "Bytes Received", filename)但执行速度没有改变.

我应该如何更改表中的索引以加快查询速度?

sqlite indexing

3
推荐指数
1
解决办法
4067
查看次数

如何在 Windows 上指定 python 解释器

我的程序是用 python 3.1 编写的(这是我犯过的最大错误)。现在我想使用一些在 2.6 上编写的模块。

我知道可以在 Unix 中指定解释器#!/usr/bin/python2.6。但是如果我使用 Windows 呢?Windows 中是否存在任何指定解释器的方法?

编辑:我希望能够同时使用两个口译员。

python

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

标签 统计

python ×2

graph ×1

indexing ×1

matplotlib ×1

numpy ×1

sqlite ×1