示例#1
0
 def test_band_datarame(self):
     start = Startup()
     bar = Bar()
     filename = 'data\\bechdel_data.json'
     df = start.load_from_file(filename)
     df = bar.band_dataframe(df, 'imdbRating')
     self.assertGreater(df.shape[1], 0)
示例#2
0
 def test_get_bar_json(self):
     start = Startup()
     bar = Bar()
     filename = 'data\\bechdel_data.json'
     df = start.load_from_file(filename)
     json = bar.get_bar_json(df, 'imdbRating', 'Total', 'Bechdel')
     print(json)
示例#3
0
 def test_get_scatter_json(self):
     start = Startup()
     scatter = Scatter()
     filename = 'data\\bechdel_data.json'
     df = start.load_from_file(filename)
     json = scatter.get_scatter_json(df, 'imdbRating', 'Metascore',
                                     'Bechdel', 'Title')
     print(json)
示例#4
0
 def test_aggregate_dataframe(self):
     start = Startup()
     bar = Bar()
     filename = 'data\\bechdel_data.json'
     df = start.load_from_file(filename)
     df = bar.band_dataframe(df, 'imdbRating')
     df = bar.group_dataframe(df, 'imdbRating', 'Bechdel')
     df = bar.aggregate_dataframe(df, 'imdbRating', 'Bechdel')
     self.assertEqual(df.shape[1], 3)
     self.assertLess(df.shape[0], 25)
示例#5
0
 def test_get_metadata(self):
     start = Startup()
     filename = 'data\\bechdel_data.json'
     df = start.load_from_file(filename)
     meta = start.get_metadata(df)
     self.assertEqual(meta['title'], 'Bechdel Analysis')
     self.assertEqual(meta['bar'], [
         "Rated", "AwardScore", "Year", "Bechdel", "Metascore", "Budget",
         "imdbRating", "Gross"
     ])
     self.assertEqual(meta['scatter'], [
         "AwardScore", "Year", "Bechdel", "Metascore", "Budget",
         "imdbRating", "Gross"
     ])
     self.assertEqual(meta['z'], ["Rated", "Year", "Bechdel"])
     self.assertEqual(meta['index'], 'Title')
示例#6
0
 def test_load_file(self):
     start = Startup()
     filename = 'data\\bechdel_data.json'
     df = start.load_from_file(filename)
     self.assertGreater(df.shape[1], 0)