data-hacks3 0.0.2__tar.gz → 0.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {data_hacks3-0.0.2 → data_hacks3-0.0.4}/PKG-INFO +9 -6
- {data_hacks3-0.0.2 → data_hacks3-0.0.4}/data_hacks/bar_chart.py +1 -1
- {data_hacks3-0.0.2 → data_hacks3-0.0.4}/data_hacks/histogram.py +4 -4
- {data_hacks3-0.0.2 → data_hacks3-0.0.4}/data_hacks/ninety_five_percent.py +2 -2
- {data_hacks3-0.0.2 → data_hacks3-0.0.4}/data_hacks/run_for.py +1 -1
- {data_hacks3-0.0.2 → data_hacks3-0.0.4}/data_hacks/sample.py +1 -1
- data_hacks3-0.0.4/data_hacks3.egg-info/PKG-INFO +18 -0
- data_hacks3-0.0.4/data_hacks3.egg-info/SOURCES.txt +10 -0
- data_hacks3-0.0.4/data_hacks3.egg-info/dependency_links.txt +1 -0
- data_hacks3-0.0.4/data_hacks3.egg-info/top_level.txt +1 -0
- data_hacks3-0.0.4/setup.cfg +4 -0
- {data_hacks3-0.0.2 → data_hacks3-0.0.4}/setup.py +2 -2
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
Metadata-Version:
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: data_hacks3
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.4
|
|
4
4
|
Summary: Command line utilities for data analysis
|
|
5
5
|
Home-page: https://github.com/nicholasren/data_hacks3
|
|
6
|
+
Download-URL: http://github.com/downloads/nicholasren/data_hacks3/data_hacks3-0.0.4.tar.gz
|
|
6
7
|
Author: ['Xiaojun Ren']
|
|
7
8
|
Author-email: nicholas.x.ren@gmail.com
|
|
8
|
-
License: UNKNOWN
|
|
9
|
-
Download-URL: http://github.com/downloads/nicholasren/data_hacks3/data_hacks3-0.0.2.tar.gz
|
|
10
|
-
Description: UNKNOWN
|
|
11
|
-
Platform: UNKNOWN
|
|
12
9
|
Classifier: Development Status :: 4 - Beta
|
|
13
10
|
Classifier: Programming Language :: Python
|
|
14
11
|
Classifier: Intended Audience :: System Administrators
|
|
15
12
|
Classifier: Topic :: Terminals
|
|
13
|
+
Dynamic: author
|
|
14
|
+
Dynamic: author-email
|
|
15
|
+
Dynamic: classifier
|
|
16
|
+
Dynamic: download-url
|
|
17
|
+
Dynamic: home-page
|
|
18
|
+
Dynamic: summary
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#!/usr/bin/env
|
|
1
|
+
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
#
|
|
4
4
|
# Copyright 2010 Bitly
|
|
@@ -102,7 +102,7 @@ def load_stream(input_stream, agg_value_key, agg_key_value):
|
|
|
102
102
|
|
|
103
103
|
def median(values, key=None):
|
|
104
104
|
if not key:
|
|
105
|
-
key =
|
|
105
|
+
key = lambda x: x # identity; py3 map() does not accept None
|
|
106
106
|
length = len(values)
|
|
107
107
|
if length % 2:
|
|
108
108
|
median_indeces = [int(length/2)]
|
|
@@ -116,7 +116,7 @@ def median(values, key=None):
|
|
|
116
116
|
|
|
117
117
|
def test_median():
|
|
118
118
|
assert 6 == median([8, 7, 9, 1, 2, 6, 3]) # odd-sized list
|
|
119
|
-
assert 4 == median([4, 5, 2, 1, 9, 10]) # even-sized int list. (4+5)/2 = 4
|
|
119
|
+
assert 4.5 == median([4, 5, 2, 1, 9, 10]) # even-sized int list. (4+5)/2 = 4.5
|
|
120
120
|
# even-sized float list. (4.0+5)/2 = 4.5
|
|
121
121
|
assert "4.50" == "%.2f" % median([4.0, 5, 2, 1, 9, 10])
|
|
122
122
|
|
|
@@ -180,7 +180,7 @@ def histogram(stream, options):
|
|
|
180
180
|
raise ValueError('# of buckets must be > 0')
|
|
181
181
|
|
|
182
182
|
def first_bucket_size(k, n):
|
|
183
|
-
"""Logarithmic buckets means, the size of bucket i+1 is twice
|
|
183
|
+
r"""Logarithmic buckets means, the size of bucket i+1 is twice
|
|
184
184
|
the size of bucket i.
|
|
185
185
|
For k+1 buckets whose sum is n, we have
|
|
186
186
|
(note, k+1 buckets, since 0 is counted as well):
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: data_hacks3
|
|
3
|
+
Version: 0.0.4
|
|
4
|
+
Summary: Command line utilities for data analysis
|
|
5
|
+
Home-page: https://github.com/nicholasren/data_hacks3
|
|
6
|
+
Download-URL: http://github.com/downloads/nicholasren/data_hacks3/data_hacks3-0.0.4.tar.gz
|
|
7
|
+
Author: ['Xiaojun Ren']
|
|
8
|
+
Author-email: nicholas.x.ren@gmail.com
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Programming Language :: Python
|
|
11
|
+
Classifier: Intended Audience :: System Administrators
|
|
12
|
+
Classifier: Topic :: Terminals
|
|
13
|
+
Dynamic: author
|
|
14
|
+
Dynamic: author-email
|
|
15
|
+
Dynamic: classifier
|
|
16
|
+
Dynamic: download-url
|
|
17
|
+
Dynamic: home-page
|
|
18
|
+
Dynamic: summary
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
setup.py
|
|
2
|
+
data_hacks/bar_chart.py
|
|
3
|
+
data_hacks/histogram.py
|
|
4
|
+
data_hacks/ninety_five_percent.py
|
|
5
|
+
data_hacks/run_for.py
|
|
6
|
+
data_hacks/sample.py
|
|
7
|
+
data_hacks3.egg-info/PKG-INFO
|
|
8
|
+
data_hacks3.egg-info/SOURCES.txt
|
|
9
|
+
data_hacks3.egg-info/dependency_links.txt
|
|
10
|
+
data_hacks3.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
data_hacks
|