13_密度分析-iObjects Python with JupyterHub for K8s

原创
2019/09/02 12:23
阅读数 80

密度分析-iObjects Python with JupyterHub for K8s

from iobjectspy import (kernel_density,
                        point_density)
import os
import sys
# 设置示例数据路径
# example_data_dir = ''
example_data_dir = '/home/jovyan/data/smdata/'

# 设置结果输出路径
out_dir = os.path.join(example_data_dir, 'out')
if not os.path.exists(out_dir):
    os.makedirs(out_dir)


def progress_func(step_event):
    sys.stdout.write('%s,%s %d %%\n' % (step_event.title, step_event.message, step_event.percent))


def kernel_density_test():
    """核密度分析,搜索半径为 0.005 """
    result = kernel_density(os.path.join(example_data_dir, 'example_data.udb/taxi'), 'passenger_count', 0.005, 0.001,
                            out_data=os.path.join(out_dir, 'out_density_analyst.udb'), progress=progress_func)

    if result is not None:
        if isinstance(result, str):
            print('核密度分析成功,结果数据集为 ' + result)
        else:
            print('核密度分析成功,结果数据集为 ' + result.name)
    else:
        print('核密度失败')


def point_density_test():
    """点密度分析,邻域形状为 CIRCLE, 邻域半径为 0.005,"""

    result = point_density(os.path.join(example_data_dir, 'example_data.udb/taxi'), 'passenger_count', 0.001,
                           'CIRCLE,0.005', 'MAP', out_data=os.path.join(out_dir, 'out_density_analyst.udb'),
                           progress=progress_func)

    if result is not None:
        if isinstance(result, str):
            print('点密度分析成功, 结果数据集为 ' + result)
        else:
            print('点密度分析成功, 结果数据集为 ' + result.name)
    else:
        print('点密度失败')
if __name__ == '__main__':
    #  核密度
    kernel_density_test()

    # 点密度
    point_density_test()
Interpolating...,Initializing interpolation... 10 %
Interpolating...,Initializing interpolation... 11 %
Interpolating...,Initializing interpolation... 12 %
Interpolating...,Initializing interpolation... 13 %
Interpolating...,Initializing interpolation... 14 %
Interpolating...,Initializing interpolation... 15 %
Interpolating...,Initializing interpolation... 16 %
Interpolating...,Initializing interpolation... 17 %
Interpolating...,Initializing interpolation... 18 %
Interpolating...,Initializing interpolation... 19 %
Interpolating...,Initializing interpolation... 20 %
Interpolating...,Initializing interpolation... 21 %
Interpolating...,Initializing interpolation... 22 %
Interpolating...,Initializing interpolation... 23 %
Interpolating...,Initializing interpolation... 24 %
Interpolating...,Initializing interpolation... 25 %
Interpolating...,Initializing interpolation... 26 %
Interpolating...,Initializing interpolation... 27 %
Interpolating...,Initializing interpolation... 28 %
Interpolating...,Initializing interpolation... 29 %
Interpolating...,Initializing interpolation... 30 %
Interpolating...,Initializing interpolation... 31 %
Interpolating...,Initializing interpolation... 32 %
Interpolating...,Initializing interpolation... 33 %
Interpolating...,Initializing interpolation... 34 %
Interpolating...,Initializing interpolation... 35 %
Interpolating...,Initializing interpolation... 36 %
Interpolating...,Initializing interpolation... 37 %
Interpolating...,Initializing interpolation... 38 %
Interpolating...,Initializing interpolation... 39 %
Interpolating...,Initializing interpolation... 40 %
Interpolating...,Initializing interpolation... 41 %
Interpolating...,Initializing interpolation... 42 %
Interpolating...,Initializing interpolation... 43 %
Interpolating...,Initializing interpolation... 44 %
Interpolating...,Initializing interpolation... 45 %
Interpolating...,Initializing interpolation... 46 %
Interpolating...,Initializing interpolation... 47 %
Interpolating...,Initializing interpolation... 48 %
Interpolating...,Initializing interpolation... 49 %
Interpolating...,Initializing interpolation... 50 %
Interpolating...,Initializing interpolation... 51 %
Interpolating...,Initializing interpolation... 52 %
Interpolating...,Initializing interpolation... 53 %
Interpolating...,Initializing interpolation... 54 %
Interpolating...,Initializing interpolation... 55 %
Interpolating...,Initializing interpolation... 56 %
Interpolating...,Initializing interpolation... 57 %
Interpolating...,Initializing interpolation... 58 %
Interpolating...,Initializing interpolation... 59 %
Interpolating...,Initializing interpolation... 60 %
Interpolating...,Initializing interpolation... 61 %
Interpolating...,Initializing interpolation... 62 %
Interpolating...,Initializing interpolation... 63 %
Interpolating...,Initializing interpolation... 64 %
Interpolating...,Initializing interpolation... 65 %
Interpolating...,Initializing interpolation... 66 %
Interpolating...,Initializing interpolation... 67 %
Interpolating...,Initializing interpolation... 68 %
Interpolating...,Initializing interpolation... 69 %
Interpolating...,Initializing interpolation... 70 %
Interpolating...,Initializing interpolation... 71 %
Interpolating...,Initializing interpolation... 72 %
Interpolating...,Initializing interpolation... 73 %
Interpolating...,Initializing interpolation... 74 %
Interpolating...,Initializing interpolation... 75 %
Interpolating...,Initializing interpolation... 76 %
Interpolating...,Initializing interpolation... 77 %
Interpolating...,Initializing interpolation... 78 %
Interpolating...,Initializing interpolation... 79 %
Interpolating...,Initializing interpolation... 80 %
Interpolating...,Initializing interpolation... 81 %
Interpolating...,Initializing interpolation... 82 %
Interpolating...,Initializing interpolation... 83 %
Interpolating...,Initializing interpolation... 84 %
Interpolating...,Initializing interpolation... 85 %
Interpolating...,Initializing interpolation... 86 %
Interpolating...,Initializing interpolation... 87 %
Interpolating...,Initializing interpolation... 88 %
Interpolating...,Initializing interpolation... 89 %
Interpolating...,Initializing interpolation... 90 %
Interpolating...,Initializing interpolation... 91 %
Interpolating...,Initializing interpolation... 92 %
Interpolating...,Initializing interpolation... 93 %
Interpolating...,Initializing interpolation... 94 %
Interpolating...,Initializing interpolation... 95 %
Interpolating...,Initializing interpolation... 96 %
Interpolating...,Initializing interpolation... 97 %
Interpolating...,Initializing interpolation... 98 %
Interpolating...,Initializing interpolation... 99 %
Interpolating...,Initializing interpolation... 100 %
Interpolating...,Analysing the kernel density [4/199]... 2 %
Interpolating...,Analysing the kernel density [13/199]... 6 %
Interpolating...,Analysing the kernel density [19/199]... 9 %
Interpolating...,Analysing the kernel density [24/199]... 12 %
Interpolating...,Analysing the kernel density [29/199]... 14 %
Interpolating...,Analysing the kernel density [34/199]... 17 %
Interpolating...,Analysing the kernel density [38/199]... 19 %
Interpolating...,Analysing the kernel density [42/199]... 21 %
Interpolating...,Analysing the kernel density [46/199]... 23 %
Interpolating...,Analysing the kernel density [49/199]... 24 %
Interpolating...,Analysing the kernel density [52/199]... 26 %
Interpolating...,Analysing the kernel density [55/199]... 27 %
Interpolating...,Analysing the kernel density [58/199]... 29 %
Interpolating...,Analysing the kernel density [60/199]... 30 %
Interpolating...,Analysing the kernel density [63/199]... 31 %
Interpolating...,Analysing the kernel density [65/199]... 32 %
Interpolating...,Analysing the kernel density [68/199]... 34 %
Interpolating...,Analysing the kernel density [70/199]... 35 %
Interpolating...,Analysing the kernel density [73/199]... 36 %
Interpolating...,Analysing the kernel density [75/199]... 37 %
Interpolating...,Analysing the kernel density [77/199]... 38 %
Interpolating...,Analysing the kernel density [80/199]... 40 %
Interpolating...,Analysing the kernel density [82/199]... 41 %
Interpolating...,Analysing the kernel density [84/199]... 42 %
Interpolating...,Analysing the kernel density [86/199]... 43 %
Interpolating...,Analysing the kernel density [88/199]... 44 %
Interpolating...,Analysing the kernel density [91/199]... 45 %
Interpolating...,Analysing the kernel density [93/199]... 46 %
Interpolating...,Analysing the kernel density [95/199]... 47 %
Interpolating...,Analysing the kernel density [97/199]... 48 %
Interpolating...,Analysing the kernel density [99/199]... 49 %
Interpolating...,Analysing the kernel density [101/199]... 50 %
Interpolating...,Analysing the kernel density [105/199]... 52 %
Interpolating...,Analysing the kernel density [107/199]... 53 %
Interpolating...,Analysing the kernel density [109/199]... 54 %
Interpolating...,Analysing the kernel density [111/199]... 55 %
Interpolating...,Analysing the kernel density [113/199]... 56 %
Interpolating...,Analysing the kernel density [116/199]... 58 %
Interpolating...,Analysing the kernel density [118/199]... 59 %
Interpolating...,Analysing the kernel density [120/199]... 60 %
Interpolating...,Analysing the kernel density [122/199]... 61 %
Interpolating...,Analysing the kernel density [124/199]... 62 %
Interpolating...,Analysing the kernel density [127/199]... 63 %
Interpolating...,Analysing the kernel density [129/199]... 64 %
Interpolating...,Analysing the kernel density [131/199]... 65 %
Interpolating...,Analysing the kernel density [134/199]... 67 %
Interpolating...,Analysing the kernel density [137/199]... 68 %
Interpolating...,Analysing the kernel density [140/199]... 70 %
Interpolating...,Analysing the kernel density [143/199]... 71 %
Interpolating...,Analysing the kernel density [146/199]... 73 %
Interpolating...,Analysing the kernel density [149/199]... 74 %
Interpolating...,Analysing the kernel density [153/199]... 76 %
Interpolating...,Analysing the kernel density [156/199]... 78 %
Interpolating...,Analysing the kernel density [161/199]... 80 %
Interpolating...,Analysing the kernel density [165/199]... 82 %
Interpolating...,Analysing the kernel density [169/199]... 84 %
Interpolating...,Analysing the kernel density [172/199]... 86 %
Interpolating...,Analysing the kernel density [176/199]... 88 %
Interpolating...,Analysing the kernel density [181/199]... 90 %
Interpolating...,Analysing the kernel density [187/199]... 93 %
Interpolating...,Analysing the kernel density [195/199]... 97 %
核密度分析成功,结果数据集为 taxi_density
Interpolating...,Point density analysis being performed [1491/141638]... 1 %
Interpolating...,Point density analysis being performed [2982/141638]... 2 %
Interpolating...,Point density analysis being performed [4473/141638]... 3 %
Interpolating...,Point density analysis being performed [5964/141638]... 4 %
Interpolating...,Point density analysis being performed [7455/141638]... 5 %
Interpolating...,Point density analysis being performed [8946/141638]... 6 %
Interpolating...,Point density analysis being performed [10437/141638]... 7 %
Interpolating...,Point density analysis being performed [11928/141638]... 8 %
Interpolating...,Point density analysis being performed [13419/141638]... 9 %
Interpolating...,Point density analysis being performed [14910/141638]... 10 %
Interpolating...,Point density analysis being performed [16401/141638]... 11 %
Interpolating...,Point density analysis being performed [17892/141638]... 12 %
Interpolating...,Point density analysis being performed [19383/141638]... 13 %
Interpolating...,Point density analysis being performed [20873/141638]... 14 %
Interpolating...,Point density analysis being performed [22364/141638]... 15 %
Interpolating...,Point density analysis being performed [23855/141638]... 16 %
Interpolating...,Point density analysis being performed [25346/141638]... 17 %
Interpolating...,Point density analysis being performed [26837/141638]... 18 %
Interpolating...,Point density analysis being performed [28328/141638]... 19 %
Interpolating...,Point density analysis being performed [29819/141638]... 20 %
Interpolating...,Point density analysis being performed [31310/141638]... 21 %
Interpolating...,Point density analysis being performed [32801/141638]... 22 %
Interpolating...,Point density analysis being performed [34292/141638]... 23 %
Interpolating...,Point density analysis being performed [35783/141638]... 24 %
Interpolating...,Point density analysis being performed [37274/141638]... 25 %
Interpolating...,Point density analysis being performed [38765/141638]... 26 %
Interpolating...,Point density analysis being performed [40256/141638]... 27 %
Interpolating...,Point density analysis being performed [41746/141638]... 28 %
Interpolating...,Point density analysis being performed [43237/141638]... 29 %
Interpolating...,Point density analysis being performed [44728/141638]... 30 %
Interpolating...,Point density analysis being performed [46219/141638]... 31 %
Interpolating...,Point density analysis being performed [47710/141638]... 32 %
Interpolating...,Point density analysis being performed [49201/141638]... 33 %
Interpolating...,Point density analysis being performed [50692/141638]... 34 %
Interpolating...,Point density analysis being performed [52183/141638]... 35 %
Interpolating...,Point density analysis being performed [53674/141638]... 36 %
Interpolating...,Point density analysis being performed [55165/141638]... 37 %
Interpolating...,Point density analysis being performed [56656/141638]... 38 %
Interpolating...,Point density analysis being performed [58147/141638]... 39 %
Interpolating...,Point density analysis being performed [59638/141638]... 40 %
Interpolating...,Point density analysis being performed [61128/141638]... 41 %
Interpolating...,Point density analysis being performed [62619/141638]... 42 %
Interpolating...,Point density analysis being performed [64110/141638]... 43 %
Interpolating...,Point density analysis being performed [65601/141638]... 44 %
Interpolating...,Point density analysis being performed [67092/141638]... 45 %
Interpolating...,Point density analysis being performed [68583/141638]... 46 %
Interpolating...,Point density analysis being performed [70074/141638]... 47 %
Interpolating...,Point density analysis being performed [71565/141638]... 48 %
Interpolating...,Point density analysis being performed [73056/141638]... 49 %
Interpolating...,Point density analysis being performed [74547/141638]... 50 %
Interpolating...,Point density analysis being performed [76038/141638]... 51 %
Interpolating...,Point density analysis being performed [77529/141638]... 52 %
Interpolating...,Point density analysis being performed [79020/141638]... 53 %
Interpolating...,Point density analysis being performed [80511/141638]... 54 %
Interpolating...,Point density analysis being performed [82001/141638]... 55 %
Interpolating...,Point density analysis being performed [83492/141638]... 56 %
Interpolating...,Point density analysis being performed [84983/141638]... 57 %
Interpolating...,Point density analysis being performed [86474/141638]... 58 %
Interpolating...,Point density analysis being performed [87965/141638]... 59 %
Interpolating...,Point density analysis being performed [89456/141638]... 60 %
Interpolating...,Point density analysis being performed [90947/141638]... 61 %
Interpolating...,Point density analysis being performed [92438/141638]... 62 %
Interpolating...,Point density analysis being performed [93929/141638]... 63 %
Interpolating...,Point density analysis being performed [95420/141638]... 64 %
Interpolating...,Point density analysis being performed [96911/141638]... 65 %
Interpolating...,Point density analysis being performed [98402/141638]... 66 %
Interpolating...,Point density analysis being performed [99893/141638]... 67 %
Interpolating...,Point density analysis being performed [101383/141638]... 68 %
Interpolating...,Point density analysis being performed [102874/141638]... 69 %
Interpolating...,Point density analysis being performed [104365/141638]... 70 %
Interpolating...,Point density analysis being performed [105856/141638]... 71 %
Interpolating...,Point density analysis being performed [107347/141638]... 72 %
Interpolating...,Point density analysis being performed [108838/141638]... 73 %
Interpolating...,Point density analysis being performed [110329/141638]... 74 %
Interpolating...,Point density analysis being performed [111820/141638]... 75 %
Interpolating...,Point density analysis being performed [113311/141638]... 76 %
Interpolating...,Point density analysis being performed [114802/141638]... 77 %
Interpolating...,Point density analysis being performed [116293/141638]... 78 %
Interpolating...,Point density analysis being performed [117784/141638]... 79 %
Interpolating...,Point density analysis being performed [119275/141638]... 80 %
Interpolating...,Point density analysis being performed [120766/141638]... 81 %
Interpolating...,Point density analysis being performed [122256/141638]... 82 %
Interpolating...,Point density analysis being performed [123747/141638]... 83 %
Interpolating...,Point density analysis being performed [125238/141638]... 84 %
Interpolating...,Point density analysis being performed [126729/141638]... 85 %
Interpolating...,Point density analysis being performed [128220/141638]... 86 %
Interpolating...,Point density analysis being performed [129711/141638]... 87 %
Interpolating...,Point density analysis being performed [131202/141638]... 88 %
Interpolating...,Point density analysis being performed [132693/141638]... 89 %
Interpolating...,Point density analysis being performed [134184/141638]... 90 %
Interpolating...,Point density analysis being performed [135675/141638]... 91 %
Interpolating...,Point density analysis being performed [137166/141638]... 92 %
Interpolating...,Point density analysis being performed [138657/141638]... 93 %
Interpolating...,Point density analysis being performed [140148/141638]... 94 %
Interpolating...,Point density analysis being performed [141638/141638]... 95 %
Interpolating...,Point density analysis being performed [141638/141638]... 100 %
点密度分析成功, 结果数据集为 taxi_density_1
展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部