当前位置: 首页>>代码示例>>Python>>正文


Python DataFrame.box_plot方法代码示例

本文整理汇总了Python中pyvttbl.DataFrame.box_plot方法的典型用法代码示例。如果您正苦于以下问题:Python DataFrame.box_plot方法的具体用法?Python DataFrame.box_plot怎么用?Python DataFrame.box_plot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pyvttbl.DataFrame的用法示例。


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

示例1: test3

# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import box_plot [as 别名]
    def test3(self):
        df=DataFrame()
  
        with self.assertRaises(Exception) as cm:
            df.box_plot('a', output_dir='output')

        self.assertEqual(str(cm.exception),
                         'Table must have data to print data')
开发者ID:marsja,项目名称:pyvttbl,代码行数:10,代码来源:test_plotting_box_plot.py

示例2: test6

# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import box_plot [as 别名]
    def test6(self):
        df=DataFrame()
        df['a']=[2,5]
        df['b']=[2,3]
  
        with self.assertRaises(KeyError) as cm:
            df.box_plot('c', output_dir='output')

        self.assertEqual(str(cm.exception),"'c'")
开发者ID:marsja,项目名称:pyvttbl,代码行数:11,代码来源:test_plotting_box_plot.py

示例3: test5

# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import box_plot [as 别名]
    def test5(self):
        df=DataFrame()
        df['a']=[2,5]
        df['b']=[2,3]
  
        with self.assertRaises(Exception) as cm:
            df.box_plot('a',42, output_dir='output')

        self.assertEqual(str(cm.exception),
                         "'int' object is not iterable")
开发者ID:marsja,项目名称:pyvttbl,代码行数:12,代码来源:test_plotting_box_plot.py

示例4: test4

# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import box_plot [as 别名]
    def test4(self):
        df=DataFrame()
        df['a']=[2]
        df['b']=[2,3]
  
        with self.assertRaises(Exception) as cm:
            df.box_plot('a', output_dir='output')

        self.assertEqual(str(cm.exception),
                         'columns have unequal lengths')
开发者ID:marsja,项目名称:pyvttbl,代码行数:12,代码来源:test_plotting_box_plot.py

示例5: test1

# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import box_plot [as 别名]
    def test1(self):
        R = {'d': [np.array([ 9,  8,  6,  8, 10,  4,  6,  5,  7,  7,
                              7,  9,  6,  6,  6, 11,  6,  3,  8,  7,
                              11, 13,  8,  6, 14, 11, 13, 13, 10, 11,
                              12, 11, 16, 11,  9, 23, 12, 10, 19, 11,
                              10, 19, 14,  5, 10, 11, 14, 15, 11, 11]),
                   np.array([ 8,  6,  4,  6,  7,  6,  5,  7,  9,  7,
                              10,  7,  8, 10,  4,  7, 10, 6,  7,  7,
                              14, 11, 18, 14, 13, 22, 17, 16, 12, 11,
                              20, 16, 16, 15, 18, 16, 20, 22, 14, 19,
                              21, 19, 17, 15, 22, 16, 22, 22, 18, 21])],
             'fname': 'output\\box(WORDS~AGE).png',
             'maintitle': 'WORDS by AGE',
             'xlabels': [u'AGE = old', u'AGE = young']}
        
        df=DataFrame()
        df.TESTMODE=True
        df.read_tbl('data/words~ageXcondition.csv')
        D=df.box_plot('WORDS',['AGE'], output_dir='output')

        self.assertEqual(D['fname'],R['fname'])
        self.assertEqual(D['maintitle'],R['maintitle'])
        self.assertEqual(D['xlabels'],R['xlabels'])
        
        for d,r in zip(np.array(D['d']).flat,
                       np.array(R['d']).flat):
            self.assertAlmostEqual(d,r)
开发者ID:marsja,项目名称:pyvttbl,代码行数:29,代码来源:test_plotting_box_plot.py

示例6: test0

# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import box_plot [as 别名]
 def test0(self):
     R = {'d': [9.0, 8.0, 6.0, 8.0, 10.0, 4.0, 6.0, 5.0, 7.0, 7.0,
                7.0, 9.0, 6.0, 6.0, 6.0, 11.0, 6.0, 3.0, 8.0, 7.0,
                11.0, 13.0, 8.0, 6.0, 14.0, 11.0, 13.0, 13.0, 10.0,
                11.0, 12.0, 11.0, 16.0, 11.0, 9.0, 23.0, 12.0, 10.0,
                19.0, 11.0, 10.0, 19.0, 14.0, 5.0, 10.0, 11.0, 14.0,
                15.0, 11.0, 11.0, 8.0, 6.0, 4.0, 6.0, 7.0, 6.0, 5.0,
                7.0, 9.0, 7.0, 10.0, 7.0, 8.0, 10.0, 4.0, 7.0, 10.0,
                6.0, 7.0, 7.0, 14.0, 11.0, 18.0, 14.0, 13.0, 22.0, 17.0,
                16.0, 12.0, 11.0, 20.0, 16.0, 16.0, 15.0, 18.0, 16.0,
                20.0, 22.0, 14.0, 19.0, 21.0, 19.0, 17.0, 15.0, 22.0,
                16.0, 22.0, 22.0, 18.0, 21.0],
          'fname': 'output\\box(WORDS).png',
          'maintitle': 'WORDS',
          'val': 'WORDS'}
     
     df=DataFrame()
     df.TESTMODE=True
     df.read_tbl('data/words~ageXcondition.csv')
     D=df.box_plot('WORDS', output_dir='output')
     
     self.assertEqual(D['fname'],R['fname'])
     self.assertEqual(D['maintitle'],R['maintitle'])
     self.assertEqual(D['val'],R['val'])
     
     for d,r in zip(np.array(D['d']).flat,
                    np.array(R['d']).flat):
         self.assertAlmostEqual(d,r)        
开发者ID:marsja,项目名称:pyvttbl,代码行数:30,代码来源:test_plotting_box_plot.py

示例7: pivotTableBoxplot

# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import box_plot [as 别名]
def pivotTableBoxplot(filename,uid,factors):
	df = DataFrame()
	df.read_tbl(os.path.join(app.config['DATA_FOLDER'], filename))
	df.box_plot('data',factors)
	origoutputfn = "box(data~"+factors[0]
	for i in range(1,len(factors)):
		origoutputfn+=("_X_"+factors[i])
	origoutputfn+=").png"
	outputfn = 'box_plot'
	for i in range(0,len(factors)):
		outputfn+='_'+factors[i]
	outputfn+='.png'

	#  TODO:  check if file exists

	#  Need to move/rename because output automatically goes to the base directory
	os.rename(os.path.join(app.config['BASEDIR'], origoutputfn), os.path.join(app.config['DATA_FOLDER'], outputfn))
	return outputfn
开发者ID:baliga-lab,项目名称:mtbwebtools,代码行数:20,代码来源:views_orig.py

示例8: test2

# 需要导入模块: from pyvttbl import DataFrame [as 别名]
# 或者: from pyvttbl.DataFrame import box_plot [as 别名]
    def test2(self):
        R = {'d': [np.array([11, 13,  8,  6, 14, 11, 13, 13, 10, 11]),
                   np.array([ 9,  8,  6,  8, 10,  4,  6,  5,  7,  7]),
                   np.array([12, 11, 16, 11,  9, 23, 12, 10, 19, 11]),
                   np.array([10, 19, 14,  5, 10, 11, 14, 15, 11, 11]),
                   np.array([ 7,  9,  6,  6,  6, 11,  6,  3,  8,  7]),
                   np.array([14, 11, 18, 14, 13, 22, 17, 16, 12, 11]),
                   np.array([8, 6, 4, 6, 7, 6, 5, 7, 9, 7]),
                   np.array([20, 16, 16, 15, 18, 16, 20, 22, 14, 19]),
                   np.array([21, 19, 17, 15, 22, 16, 22, 22, 18, 21]),
                   np.array([10,  7,  8, 10,  4,  7, 10,  6,  7,  7])],
             'fname': 'output\\box(WORDS~AGE_X_CONDITION).png',
             'maintitle': 'WORDS by AGE * CONDITION',
             'xlabels': [u'AGE = old\nCONDITION = adjective',
                         u'AGE = old\nCONDITION = counting',
                         u'AGE = old\nCONDITION = imagery',
                         u'AGE = old\nCONDITION = intention',
                         u'AGE = old\nCONDITION = rhyming',
                         u'AGE = young\nCONDITION = adjective',
                         u'AGE = young\nCONDITION = counting',
                         u'AGE = young\nCONDITION = imagery',
                         u'AGE = young\nCONDITION = intention',
                         u'AGE = young\nCONDITION = rhyming']}
        
        df=DataFrame()
        df.TESTMODE=True
        df.read_tbl('data/words~ageXcondition.csv')
        D=df.box_plot('WORDS',['AGE','CONDITION'], output_dir='output')

        self.assertEqual(D['fname'],R['fname'])
        self.assertEqual(D['maintitle'],R['maintitle'])
        self.assertEqual(D['xlabels'],R['xlabels'])
        
        for d,r in zip(np.array(D['d']).flat,
                       np.array(R['d']).flat):
            self.assertAlmostEqual(d,r)
开发者ID:marsja,项目名称:pyvttbl,代码行数:38,代码来源:test_plotting_box_plot.py


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