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


Python data_operations.DataCleaning类代码示例

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


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

示例1: _prepareData

    def _prepareData(self, column, cleanIt=True):
        values = []
        allCars = self.database.getAllCars()
        if cleanIt:
            allCars = DataCleaning.cleanAllData(allCars)
        columnId = COLUMNIDDICTIONARY.get(column, 0)
        for car in allCars:
            values.append(car[columnId])

        return values
开发者ID:madamczak,项目名称:cardata,代码行数:10,代码来源:plots.py

示例2: _addNewVersionCategory

    def _addNewVersionCategory(self, item, model, ver, count):
        versionName = DataCleaning.normalize(ver[0])
        pattern1 = re.compile(".*\(\d+-")
        pattern2 = re.compile(".*T\d")

        if not self.db.brandLinkIsPresentInDatabase(ver[1]) \
                and (pattern1.match(str(versionName)) or pattern2.match(str(versionName))):
            self.db.insertVersionToDatabase(count, item[0], model[0], ver[0], ver[1])
            return 1
        else:
            return 0
开发者ID:madamczak,项目名称:cardata,代码行数:11,代码来源:AllegroBrandsCollector.py

示例3: test_normalize_number_of_doors

    def test_normalize_number_of_doors(self):
        self.assertEqual(DataCleaning.normalizeNumberOfDoors("2"), "2/3")
        self.assertEqual(DataCleaning.normalizeNumberOfDoors("3"), "2/3")
        self.assertEqual(DataCleaning.normalizeNumberOfDoors("2/3"), "2/3")

        self.assertEqual(DataCleaning.normalizeNumberOfDoors("4"), "4/5")
        self.assertEqual(DataCleaning.normalizeNumberOfDoors("5"), "4/5")
        self.assertEqual(DataCleaning.normalizeNumberOfDoors("4/5"), "4/5")

        self.assertEqual(DataCleaning.normalizeNumberOfDoors("30"), "unknown")
开发者ID:madamczak,项目名称:cardata,代码行数:10,代码来源:unit_tests.py

示例4: test_strips_number_of_doors

 def test_strips_number_of_doors(self):
     toStrip = "4/5"
     self.assertEqual(DataCleaning.stripDecimalValue(toStrip), "4/5")
开发者ID:madamczak,项目名称:cardata,代码行数:3,代码来源:unit_tests.py

示例5: test_internationalizes_gearbox_half_automatic2

 def test_internationalizes_gearbox_half_automatic2(self):
     toInternationalize = "poautomatyczna (asg, tiptronic)"
     self.assertEqual(DataCleaning.internationalizeGearbox(toInternationalize), "half-automatic")
开发者ID:madamczak,项目名称:cardata,代码行数:3,代码来源:unit_tests.py

示例6: test_normalizes_color3

 def test_normalizes_color3(self):
     toNormalize = u"\n    Żółty        \n"
     self.assertEqual(DataCleaning.normalize(toNormalize), "zolty")
开发者ID:madamczak,项目名称:cardata,代码行数:3,代码来源:unit_tests.py

示例7: test_normalizes_power

 def test_normalizes_power(self):
     toNormalize = u"200KM"
     self.assertEqual(DataCleaning.normalize(toNormalize), "200km")
开发者ID:madamczak,项目名称:cardata,代码行数:3,代码来源:unit_tests.py

示例8: test_strips_simple_literal

 def test_strips_simple_literal(self):
     toStrip = "AAAaaa"
     self.assertEqual(DataCleaning.stripDecimalValue(toStrip), "")
开发者ID:madamczak,项目名称:cardata,代码行数:3,代码来源:unit_tests.py

示例9: test_normalizes_color

 def test_normalizes_color(self):
     toNormalize = u"\n    Biały        \n"
     self.assertEqual(DataCleaning.normalize(toNormalize), "biay")
开发者ID:madamczak,项目名称:cardata,代码行数:3,代码来源:unit_tests.py

示例10: test_clean_year

 def test_clean_year(self):
     self.assertEqual(len(DataCleaning.cleanYear(self.listOfCars)), 1)
开发者ID:madamczak,项目名称:cardata,代码行数:2,代码来源:unit_tests.py

示例11: test_clean_mileage

 def test_clean_mileage(self):
     self.assertEqual(len(DataCleaning.cleanMileage(self.listOfCars)), 1)
开发者ID:madamczak,项目名称:cardata,代码行数:2,代码来源:unit_tests.py

示例12: test_internationalizes_gearbox_cvt2

 def test_internationalizes_gearbox_cvt2(self):
     toInternationalize = "automatyczna bezstopniowa cvt"
     self.assertEqual(DataCleaning.internationalizeGearbox(toInternationalize), "automatic - cvt")
开发者ID:madamczak,项目名称:cardata,代码行数:3,代码来源:unit_tests.py

示例13: test_internationalizes_gearbox_unknown

 def test_internationalizes_gearbox_unknown(self):
     toInternationalize = "aaabbb"
     self.assertEqual(DataCleaning.internationalizeGearbox(toInternationalize), "unknown")
开发者ID:madamczak,项目名称:cardata,代码行数:3,代码来源:unit_tests.py

示例14: test_internationalizes_gearbox_dsg

 def test_internationalizes_gearbox_dsg(self):
     toInternationalize = "automatyczna dwusprzeglowa (dct, dsg)"
     self.assertEqual(DataCleaning.internationalizeGearbox(toInternationalize), "automatic - dct, dsg")
开发者ID:madamczak,项目名称:cardata,代码行数:3,代码来源:unit_tests.py

示例15: test_internationalizes_gearbox_automatic2

 def test_internationalizes_gearbox_automatic2(self):
     toInternationalize = "automatyczna hydrauliczna (klasyczna)"
     self.assertEqual(DataCleaning.internationalizeGearbox(toInternationalize), "automatic")
开发者ID:madamczak,项目名称:cardata,代码行数:3,代码来源:unit_tests.py


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