• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python show.show函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中show.show函数的典型用法代码示例。如果您正苦于以下问题:Python show函数的具体用法?Python show怎么用?Python show使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了show函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: drawLine

def drawLine(p1, p2, varargin):
    """Draws a line from point p1 to point p2 and holds the
    current figure
    """

    plt.plot(np.column_stack(p1(1), p2(1)), np.column_stack(p1(2), p2(2)), varargin)
    show()
开发者ID:CercaTrova,项目名称:Coursera-Stanford-ML-Python,代码行数:7,代码来源:drawLine.py


示例2: _show_folder

 def _show_folder(self, index, path, goto, single_pane, other_group):
     if index != -1:
         choice = self.window.folders()[index]
         if path == choice:
             show(self.window, path, goto=goto, single_pane=single_pane, other_group=other_group)
         else:
             show(self.window, choice, single_pane=single_pane, other_group=other_group)
开发者ID:aziz,项目名称:SublimeFileBrowser,代码行数:7,代码来源:dired.py


示例3: open_item

 def open_item(self, fqn, window, new_view):
     if isdir(fqn):
         show(window, fqn, ignore_existing=new_view)
     elif exists(fqn):  # ignore 'item <error>'
         self.last_created_view = window.open_file(fqn)
     else:
         sublime.status_message(u'File does not exist (%s)' % (basename(fqn.rstrip(os.sep)) or fqn))
开发者ID:aziz,项目名称:SublimeFileBrowser,代码行数:7,代码来源:dired.py


示例4: plotBoundary

def plotBoundary(theta, X, y):
    plotDecisionBoundary(theta, X.values, y.values)
    plt.title(r'$\lambda$ = ' + str(Lambda))

    # Labels and Legend
    plt.xlabel('Microchip Test 1')
    plt.ylabel('Microchip Test 2')
    show()
开发者ID:Gabeesh,项目名称:Coursera-Stanford-ML-Python,代码行数:8,代码来源:ex2_reg.py


示例5: test_vsm

    def test_vsm(self):
        ds = Document.from_texts([documents.DOCUMENT_1, documents.DOCUMENT_2, documents.DOCUMENT_3])
        vsm = VSM(ds)

        query = "nobel physics britian idea"
        show(query)

        results = vsm.query(query)
        show(results)
开发者ID:CalumJEadie,项目名称:academic,代码行数:9,代码来源:test_question_4.py


示例6: run

    def run(self, edit):
        parent = dirname(self.path.rstrip(os.sep))
        if parent != os.sep:
            parent += os.sep
        if parent == self.path:
            return

        view_id = (self.view.id() if reuse_view() else None)
        show(self.view.window(), parent, view_id, goto=basename(self.path.rstrip(os.sep)))
开发者ID:twistedmove,项目名称:SublimeFileBrowser,代码行数:9,代码来源:dired.py


示例7: train

	def train(self, episode_len, episode_nbr, behavior='balance'):
		tau = 0.001
		speedup = 0.1
		self.pos_log = []
		for j in range(episode_nbr):			
			self.run_episode(episode_len,tau,behavior,'train')
			if (j+1)%100 == 0: print "%i episodes run" % (j+1)
	
		self.run_episode(episode_len,tau,behavior,'show')
		
		show(behavior+'.html',self.pos_log,tau/speedup)
开发者ID:tsybulkin,项目名称:hop2,代码行数:11,代码来源:sim.py


示例8: goto_directory

 def goto_directory(self, filenames, window, new_view):
     '''If reuse view is turned on and the only item is a directory, refresh the existing view'''
     if new_view and reuse_view():
         return False
     fqn = filenames[0]
     if len(filenames) == 1 and isdir(fqn):
         show(self.view.window(), fqn, view_id=self.view.id())
         return True
     elif fqn == PARENT_SYM:
         self.view.window().run_command("dired_up")
         return True
     return False
开发者ID:aziz,项目名称:SublimeFileBrowser,代码行数:12,代码来源:dired.py


示例9: run

def run(tau,T,playback_speedup=1):
	assert tau < 0.1
	assert tau > 0
	assert T > 0

	bot = Robot()
	t = 0
	while t < T:
		bot.next_pos(tau)
		t += tau
		#print '\nt =', t, 'pos:\n', bot.q, bot.q_d
		if bot.fell(): break

	show('no_control.html',bot.state_log,tau/playback_speedup)
开发者ID:tsybulkin,项目名称:jumper,代码行数:14,代码来源:sim.py


示例10: plotData

def plotData(X, y):
    """plots the data points with + for the positive examples
    and o for the negative examples. X is assumed to be a Mx2 matrix.

    Note: This was slightly modified such that it expects y = 1 or y = 0
    """
    plt.figure()

# Find Indices of Positive and Negative Examples
    pos = np.where(y==1, True, False).flatten()
    neg = np.where(y==0, True, False).flatten()

# Plot Examples
    plt.plot(X[pos,0], X[pos, 1], 'k+', linewidth=1, markersize=7)
    plt.plot(X[neg,0], X[neg, 1], 'ko', color='y', markersize=7)
    show()
开发者ID:CercaTrova,项目名称:Coursera-Stanford-ML-Python,代码行数:16,代码来源:plotData.py


示例11: visualizeFit

def visualizeFit(X, mu, sigma2):
    """
    This visualization shows you the
    probability density function of the Gaussian distribution. Each example
    has a location (x1, x2) that depends on its feature values.
    """
    n = np.linspace(0,35,71)
    X1 = np.meshgrid(n,n)
    Z = multivariateGaussian(np.column_stack((X1[0].T.flatten(), X1[1].T.flatten())),mu,sigma2)
    Z = Z.reshape(X1[0].shape)

    plt.plot(X[:, 0], X[:, 1],'bx')
    # Do not plot if there are infinities
    if not isinf(np.sum(Z)):
        plt.contour(X1[0], X1[1], Z, 10.0**np.arange(-20, 0, 3).T)
        show()
开发者ID:Gabeesh,项目名称:Coursera-Stanford-ML-Python,代码行数:16,代码来源:visualizeFit.py


示例12: run

    def run(self, edit, new_view=0, other_group=0, preview=0, and_close=0, inline=0):
        path = self.path
        filenames = self.get_selected() if not new_view else self.get_marked() or self.get_selected()

        # If reuse view is turned on and the only item is a directory, refresh the existing view.
        if not new_view and reuse_view():
            fqn = join(path, filenames[0])
            if inline and '<empty>' == fqn[~6:]:
                return
            if len(filenames) == 1 and isdir(fqn):
                if inline:
                    # if directory was unfolded, then itРђЎll be folded and unfolded again
                    self.view.run_command('dired_fold', {'update': True})
                show(self.view.window(), fqn, view_id=self.view.id(), inline=inline)
                return
            elif len(filenames) == 1 and filenames[0] == PARENT_SYM:
                self.view.window().run_command("dired_up")
                return

        if other_group or preview or and_close:
            # we need group number of FB view, hence twice check for other_group
            dired_view = self.view
            nag = self.view.window().active_group()
        w = self.view.window()
        for filename in filenames:
            fqn = join(path, filename.replace('<empty>', '').rstrip())
            if exists(fqn): # ignore 'item <error>'
                if isdir(fqn):
                    show(w, fqn, ignore_existing=new_view)
                else:
                    if preview:
                        w.focus_group(self._other_group(w, nag))
                        v = w.open_file(fqn, sublime.TRANSIENT)
                        w.set_view_index(v, self._other_group(w, nag), 0)
                        w.focus_group(nag)
                        w.focus_view(dired_view)
                        break # preview is possible for a single file only
                    else:
                        v = w.open_file(fqn)
                        if other_group:
                            w.focus_view(dired_view)
                            w.set_view_index(v, self._other_group(w, nag), 0)
                            w.focus_view(v)
        if and_close:
            w.focus_view(dired_view)
            w.run_command("close")
            w.focus_view(v)
开发者ID:AlexKordic,项目名称:SublimeFileBrowser,代码行数:47,代码来源:dired.py


示例13: run

    def run(self, edit):
        path = self.path
        parent = dirname(path.rstrip(os.sep))
        if parent != os.sep and parent[1:] != ':\\':
            # need to avoid c:\\\\
            parent += os.sep
        if parent == path and NT:
            parent = 'ThisPC'
        elif parent == path:
            return
        elif path == 'ThisPC\\':
            self.view.run_command('dired_refresh')
            return

        view_id = (self.view.id() if reuse_view() else None)
        goto = basename(path.rstrip(os.sep)) or path
        show(self.view.window(), parent, view_id, goto=goto)
开发者ID:aziz,项目名称:SublimeFileBrowser,代码行数:17,代码来源:dired.py


示例14: on_pick_point

 def on_pick_point(self, index):
     if index == -1:
         return
     name, target = self.points[index]
     if exists(target) and isdir(target) and target[-1] == os.sep:
         show(self.view.window(), target, view_id=self.view.id())
         status_message("Jumping to point '{0}' complete".format(name))
     else:
         # workaround ST3 bag https://github.com/SublimeText/Issues/issues/39
         self.view.window().run_command('hide_overlay')
         msg = u"Can't jump to '{0} → {1}'.\n\nRemove that jump point?".format(name, target)
         if ok_cancel_dialog(msg):
             points = load_jump_points()
             del points[name]
             save_jump_points(points)
             status_message(u"Jump point '{0}' was removed".format(name))
             self.view.run_command('dired_refresh')
开发者ID:AlexKordic,项目名称:SublimeFileBrowser,代码行数:17,代码来源:jumping.py


示例15: run_wss

def run_wss(T, speedup=0.1, tau=0.001):
	bot = Robot()
	bot.q = np.array([0.4, 0., 1.7, 1.35]) 
	bot.psi = 0.5
	
	t = 0.
	while t < T:
		sim_time, action = bot.balance_policy(tau,0.2)
		bot.psi += action/10.
		print "action:",action,"bot state:",bot.q, bot.q_d
		
		[ bot.next_pos(tau) for _ in range(5)]
		t += tau*5

		bot.pos_log.append(tuple(bot.q))
		if bot.is_down(): break

	show('short_sims.html',bot.pos_log,tau/speedup)
开发者ID:tsybulkin,项目名称:hop2,代码行数:18,代码来源:sim.py


示例16: plotDataPoints

def plotDataPoints(X, idx):

    """plots data points in X, coloring them so that those
    with the same index assignments in idx have the same color
    """
    pass
    # Create palette
    # palette = hsv(K + 1)
    # colors = palette(idx, :)
    #
    # # Plot the data

    # c = dict(enumerate(np.eye(3)))
    # colors=idx
    map = plt.get_cmap("jet")
    idxn = idx.astype("float") / max(idx.astype("float"))
    colors = map(idxn)
    plt.scatter(X[:, 0], X[:, 1], 15, edgecolors=colors, marker="o", facecolors="none", lw=0.5)
    show()
开发者ID:jrbadiabo,项目名称:Coursera-Stanford-ML-Class,代码行数:19,代码来源:plotDataPoints.py


示例17: displayData

def displayData(X):
    """displays 2D data
      stored in X in a nice grid. It returns the figure handle h and the
      displayed array if requested."""

# Compute rows, cols
    m, n = X.shape
    example_width = round(np.sqrt(n))
    example_height = (n / example_width)

# Compute number of items to display
    display_rows = np.floor(np.sqrt(m))
    display_cols = np.ceil(m / display_rows)

# Between images padding
    pad = 1

# Setup blank display
    display_array = - np.ones((pad + display_rows * (example_height + pad),
                           pad + display_cols * (example_width + pad)))

# Copy each example into a patch on the display array
    curr_ex = 0
    for j in np.arange(display_rows):
        for i in np.arange(display_cols):
            if curr_ex > m:
                break
            # Get the max value of the patch
            max_val = np.max(np.abs(X[curr_ex, : ]))
            rows = [pad + j * (example_height + pad) + x for x in np.arange(example_height+1)]
            cols = [pad + i * (example_width + pad)  + x for x in np.arange(example_width+1)]
            display_array[min(rows):max(rows), min(cols):max(cols)] = X[curr_ex, :].reshape(example_height, example_width) / max_val
            curr_ex = curr_ex + 1
        if curr_ex > m:
            break

# Display Image
    display_array = display_array.astype('float32')
    plt.imshow(display_array.T)
    plt.set_cmap('gray')
# Do not show axis
    plt.axis('off')
    show()
开发者ID:Gabeesh,项目名称:Coursera-Stanford-ML-Python,代码行数:43,代码来源:displayData.py


示例18: run

    def run(self, edit):
        pt = self.view.sel()[0].a
        row, col = self.view.rowcol(pt)
        points = [[n, t] for n, t in jump_points()]
        current_project = [points[row - 3][1]]
        settings = load_settings('dired.sublime-settings')
        smart_jump = settings.get('dired_smart_jump', False)
        if smart_jump and len(self.view.window().views()) == 1:
            show(self.view.window(), current_project[0])
        else:
            self.view.run_command("dired_open_in_new_window", {"project_folder": current_project})

        def close_view(view):
            if ST3:
                view.close()
            else:
                view.window().run_command("close_file")

        sublime.set_timeout(close_view(self.view), 100)
开发者ID:Siva7891,项目名称:SublimeFileBrowser,代码行数:19,代码来源:jumping.py


示例19: run

    def run(self, edit, new_view=False):
        path = self.path
        filenames = self.get_selected()

        # If reuse view is turned on and the only item is a directory, refresh the existing view.
        if not new_view and reuse_view():
            if len(filenames) == 1 and isdir(join(path, filenames[0])):
                fqn = join(path, filenames[0])
                show(self.view.window(), fqn, view_id=self.view.id())
                return
            elif len(filenames) == 1 and filenames[0] == PARENT_SYM:
                self.view.window().run_command("dired_up")
                return

        for filename in filenames:
            fqn = join(path, filename)
            if isdir(fqn):
                show(self.view.window(), fqn, ignore_existing=new_view)
            else:
                self.view.window().open_file(fqn)
开发者ID:webtotma,项目名称:SublimeFileBrowser,代码行数:20,代码来源:dired.py


示例20: run

def run(T, speedup=0.1, tau=0.001):
	assert tau < 0.1
	assert tau > 0
	assert T > 0

	bot = Robot()
	bot.q = np.array([0.6, 0., 2.8, 1.5]) # 
	bot.psi = 1.1
	"""
	bot.q = np.array([0.7, 0., 2.0, 1.255]) # salto settings
	bot.psi = 0.9
	"""
	t = 0.
	while t < T:
		#bot.psi = get_psi(get_policy(EPS,bot.q,bot.q_d))
		bot.next_pos(tau)
		t += tau
		bot.pos_log.append(tuple(bot.q))
		if bot.is_down(): break

	show('no_control.html',bot.pos_log,tau/speedup)
开发者ID:tsybulkin,项目名称:hop2,代码行数:21,代码来源:sim.py



注:本文中的show.show函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python show_message.error函数代码示例发布时间:2022-05-27
下一篇:
Python shove.Shove类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap