diff --git a/README.md b/README.md index 35c006c..977072f 100755 --- a/README.md +++ b/README.md @@ -60,9 +60,12 @@ Returns: ```shell normalize_dataframe(df, dependencies) ``` -Normalizes dataframe based on the dependencies given. +Normalizes dataframe based on the dependencies given. Keys for the newly created DataFrames can only be columns that are strings, ints, or categories. Keys are chosen according to the priority: +1) shortest lenghts +2) has "id" in some form in the name of an attribute +3) has attribute furthest to left in the table -Returns: +Returns:x `new_dfs` (list[pd.DataFrame]) : list of new dataframes @@ -71,7 +74,7 @@ Returns: ```shell make_entityset(df, dependencies, name=None, time_index=None): ``` -Creates a normalized EntitySet from dataframe based on the dependencies given. +Creates a normalized EntitySet from dataframe based on the dependencies given. Keys are chosen in the same fashion as for `normalize_dataframe`and a new index will be created if any key has more than a single attribute. Returns: diff --git a/autonormalize/.DS_Store b/autonormalize/.DS_Store index 2a25c5e..e6ef6ee 100644 Binary files a/autonormalize/.DS_Store and b/autonormalize/.DS_Store differ diff --git a/autonormalize/autonormalize.py b/autonormalize/autonormalize.py index 25cb844..cc3727d 100644 --- a/autonormalize/autonormalize.py +++ b/autonormalize/autonormalize.py @@ -4,7 +4,7 @@ from .classes import Dependencies -def find_dependencies(df, accuracy=0.98, rep_percent=0.85, index=None): +def find_dependencies(df, accuracy=0.98, index=None): """ Finds dependencies within dataframe df with the DFD search algorithm. Returns the dependencies as a Dependencies object. @@ -17,11 +17,6 @@ def find_dependencies(df, accuracy=0.98, rep_percent=0.85, index=None): required in order to conclude a dependency (i.e. with accuracy = 0.98, 0.98 of the rows must hold true the dependency LHS --> RHS) - rep_percent (0 < float <= 1.00; default = 0.85) : the maximum amount of - data that may be unique in order to determine a dependency (i.e. with - rep_percent = 0.85, if less than 15% of rows are repeated for the columns - in LHS + RHS, no dependency will be concluded.) - index (str, optional) : name of column that is intended index of df Returns: @@ -29,7 +24,7 @@ def find_dependencies(df, accuracy=0.98, rep_percent=0.85, index=None): dependencies (Dependencies) : the dependencies found in the data within the contraints provided """ - deps = Dependencies(dfd.dfd(df, accuracy, rep_percent, index)) + deps = Dependencies(dfd.dfd(df, accuracy, index)) if index is None: prim_key = normalize.choose_index(deps.find_candidate_keys(), df) deps.set_prim_key(prim_key) @@ -57,7 +52,11 @@ def normalize_dependencies(df, dependencies): def normalize_dataframe(df, dependencies): """ - Normalizes a dataframe based on the dependencies given. + Normalizes a dataframe based on the dependencies given. Keys for the newly + created DataFrames can only be columns that are strings, ints, or + categories. Keys are chosen according to the priority: + 1) shortest lenghts 2) has "id" in some form in the name of an attribute + 3) has attribute furthest to left in the table Arguments: df (pd.DataFrame) : dataframe to split up @@ -74,6 +73,10 @@ def normalize_dataframe(df, dependencies): def make_entityset(df, dependencies, name=None, time_index=None): """ Creates a normalized EntitySet from df based on the dependencies given. + Keys for the newly created DataFrames can only be columns that are strings, + ints, or categories. Keys are chosen according to the priority: + 1) shortest lenghts 2) has "id" in some form in the name of an attribute + 3) has attribute furthest to left in the table Arguments: df (pd.DataFrame) : dataframe to normalize and make entity set from @@ -107,7 +110,7 @@ def make_entityset(df, dependencies, name=None, time_index=None): return ft.EntitySet(name, entities, relationships) -def auto_entityset(df, accuracy=0.98, rep_percent=0.85, index=None, name=None, time_index=None): +def auto_entityset(df, accuracy=0.98, index=None, name=None, time_index=None): """ Creates a normalized entityset from a dataframe. @@ -119,11 +122,6 @@ def auto_entityset(df, accuracy=0.98, rep_percent=0.85, index=None, name=None, t required in order to conclude a dependency (i.e. with accuracy = 0.98, 0.98 of the rows must hold true the dependency LHS --> RHS) - rep_percent (0 < float <= 1.00; default = 0.85) : the maximum amount of - data that may be unique in order to determine a dependency (i.e. with - rep_percent = 0.85, if less than 15% of rows are repeated for the columns - in LHS + RHS, no dependency will be concluded.) - index (str, optional) : name of column that is intended index of df name (str, optional) : the name of created EntitySet @@ -134,7 +132,7 @@ def auto_entityset(df, accuracy=0.98, rep_percent=0.85, index=None, name=None, t entityset (ft.EntitySet) : created entity set """ - return make_entityset(df, find_dependencies(df, accuracy, rep_percent, index), name, time_index) + return make_entityset(df, find_dependencies(df, accuracy, index), name, time_index) def auto_normalize(df): diff --git a/autonormalize/demos/AutoNormalize + FeatureTools Demo.ipynb b/autonormalize/demos/AutoNormalize + FeatureTools Demo.ipynb index f1f92ae..f8b7b5a 100644 --- a/autonormalize/demos/AutoNormalize + FeatureTools Demo.ipynb +++ b/autonormalize/demos/AutoNormalize + FeatureTools Demo.ipynb @@ -16,7 +16,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ @@ -39,7 +39,7 @@ }, { "cell_type": "code", - "execution_count": 3, + "execution_count": 2, "metadata": { "scrolled": true }, @@ -146,7 +146,7 @@ "2 1973-07-28 A " ] }, - "execution_count": 3, + "execution_count": 2, "metadata": {}, "output_type": "execute_result" } @@ -174,7 +174,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -254,7 +254,7 @@ "3 1 2014-01-03 18:39:30 2834.44" ] }, - "execution_count": 6, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } @@ -278,7 +278,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -351,7 +351,7 @@ "3 1 2014-01-03 17:39:30 True" ] }, - "execution_count": 7, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -364,7 +364,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 5, "metadata": { "scrolled": false }, @@ -419,7 +419,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 6, "metadata": { "scrolled": true }, @@ -428,7 +428,7 @@ "name": "stderr", "output_type": "stream", "text": [ - "100%|██████████| 10/10 [00:13<00:00, 1.41s/it]\n" + "100%|██████████| 10/10 [00:01<00:00, 7.11it/s]\n" ] }, { @@ -449,7 +449,7 @@ } ], "source": [ - "es = an.auto_entityset(transaction_df, name=\"transactions\", time_index='transaction_time')\n", + "es = an.auto_entityset(transaction_df, accuracy=1, name=\"transactions\", time_index='transaction_time')\n", "es.add_last_time_indexes()\n", "print(es)" ] @@ -643,15 +643,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "\n", - "\n", - "*write*\n", - "\n", - "\n", - "\n", - "In the feature matrix, let’s extract the labels and fill any missing values with zeros. Then, one-hot encode all categorical features by using encode_features().\n", - "\n", - "After preprocessing, we split the features and corresponding labels each into training and testing sets." + "Now we preprocess our features, and split the features and corresponding labels into training and testing sets." ] }, { @@ -672,6 +664,13 @@ ")" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "Now, we train a random forest classifer on the training set, and then test the models performance by evaluating predictions on the testing set." + ] + }, { "cell_type": "code", "execution_count": 10, @@ -702,7 +701,9 @@ { "cell_type": "code", "execution_count": 11, - "metadata": {}, + "metadata": { + "scrolled": true + }, "outputs": [ { "name": "stdout", @@ -725,6 +726,13 @@ "print(classification_report(y_test, y_hat))" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "This plot is based on scores obtained by the model to illustrate which features are considered important for predictions." + ] + }, { "cell_type": "code", "execution_count": 14, diff --git a/autonormalize/dfd.py b/autonormalize/dfd.py index f2332bd..d6a39ba 100644 --- a/autonormalize/dfd.py +++ b/autonormalize/dfd.py @@ -10,7 +10,7 @@ # run script.py to see a couple examples -def dfd(df, accuracy, rep_percent, index=None): +def dfd(df, accuracy, index=None): """ Main loop of DFD algorithm. It returns all the dependencies represented in the data in dataframe df. Refer to section 3.2 of paper for literature. @@ -28,11 +28,6 @@ def dfd(df, accuracy, rep_percent, index=None): to conclude a dependency (i.e. with accuracy = 0.98, 0.98 of the rows must hold true the dependency LHS --> RHS) - rep_percent (0 < float <= 1.00) : the maximum amount of - data that may be unique in order to determine a dependency (i.e. with - rep_percent = 0.85, if less than 15% of rows are repeated for the columns - in LHS + RHS, no dependency will be concluded.) - Returns: minimal_dependencies (DfdDependencies) : the minimal dependencies @@ -49,12 +44,12 @@ def dfd(df, accuracy, rep_percent, index=None): non_uniq.remove(i) dependencies.add_unique_lhs(i) for i in tqdm(non_uniq): - lhss = find_LHSs(i, non_uniq, df, partitions, accuracy, masks, rep_percent) + lhss = find_LHSs(i, non_uniq, df, partitions, accuracy, masks) dependencies.add_LHSs(i, lhss) return dependencies -def find_LHSs(rhs, attrs, df, partitions, accuracy, masks, rep_percent): +def find_LHSs(rhs, attrs, df, partitions, accuracy, masks): """ Finds all LHS sets of attributes that satisfy a dependency relation for the RHS attribute i. This is such that LHS --> RHS. @@ -76,11 +71,6 @@ def find_LHSs(rhs, attrs, df, partitions, accuracy, masks, rep_percent): masks (Masks) : contains past calculated masks - rep_percent (0 < float <= 1.00) : the maximum amount of data that may be - unique in order to determine a dependency (i.e. with rep_percent = 0.85, - if less than 15% of rows are repeated for the columns in LHS + RHS, no - dependency will be concluded.) - Returns: lhss (LHSs) : all the LHS that determine rhs """ @@ -106,7 +96,7 @@ def find_LHSs(rhs, attrs, df, partitions, accuracy, masks, rep_percent): else: node.infer_type() if node.category == 0: - if compute_partitions(df, rhs, node.attrs, partitions, accuracy, masks, rep_percent): + if compute_partitions(df, rhs, node.attrs, partitions, accuracy, masks): if node.is_minimal(): min_deps.add_dep(node.attrs) node.category = 2 @@ -296,7 +286,7 @@ def generate_next_seeds(max_non_deps, min_deps, lhs_attrs): return list(seeds) -def compute_partitions(df, rhs, lhs_set, partitions, accuracy, masks, rep_percent): +def compute_partitions(df, rhs, lhs_set, partitions, accuracy, masks): """ Returns true if lhs_set --> rhs for dataframe df. @@ -318,17 +308,12 @@ def compute_partitions(df, rhs, lhs_set, partitions, accuracy, masks, rep_percen masks (Masks) : contains past calculated masks - rep_percent (0 < float <= 1.00) : the maximum amount of data that may be - unique in order to determine a dependency (i.e. with rep_percent = 0.85, - if less than 15% of rows are repeated for the columns in LHS + RHS, no - dependency will be concluded.) - Returns: is_dependency (bool) : True if is a dependency, false otherwise """ # for approximate dependencies see TANE section 2.3s if accuracy < 1: - return approximate_dependencies(list(lhs_set), rhs, df, accuracy, masks, rep_percent) + return approximate_dependencies(list(lhs_set), rhs, df, accuracy, masks) part_rhs = partition(lhs_set.union(set([rhs])), df, partitions) # if part_rhs > df.shape[0] * rep_percent: # return False @@ -347,7 +332,7 @@ def partition(attrs, df, partitions): return shape -def approximate_dependencies(lhs_set, rhs, df, accuracy, masks, rep_percent): +def approximate_dependencies(lhs_set, rhs, df, accuracy, masks): """ Checks whether the columns represented in lhs_set functionally determines the column rhs for the dataframe df. diff --git a/autonormalize/profile.svg b/autonormalize/profile.svg deleted file mode 100644 index d5f0112..0000000 --- a/autonormalize/profile.svg +++ /dev/null @@ -1,308 +0,0 @@ -py-spy Reset ZoomSearch <module> (pyspy2.py:3) (124 samples, 0.14%)_find_and_load (<frozen importlib._bootstrap>:983) (124 samples, 0.14%)_find_and_load_unlocked (<frozen importlib._bootstrap>:967) (124 samples, 0.14%)_load_unlocked (<frozen importlib._bootstrap>:677) (124 samples, 0.14%)exec_module (<frozen importlib._bootstrap_external>:728) (124 samples, 0.14%)_call_with_frames_removed (<frozen importlib._bootstrap>:219) (124 samples, 0.14%)read (pandas/io/parsers.py:1139) (826 samples, 0.96%)read (pandas/io/parsers.py:1995) (826 samples, 0.96%)<module> (pyspy2.py:58) (919 samples, 1.06%)parser_f (pandas/io/parsers.py:702) (919 samples, 1.06%)_read (pandas/io/parsers.py:435) (910 samples, 1.05%)helper (autonormalize/classes.py:498) (96 samples, 0.11%)find_closure (autonormalize/classes.py:603) (96 samples, 0.11%)helper (autonormalize/classes.py:601) (92 samples, 0.11%)helper (autonormalize/classes.py:601) (89 samples, 0.10%)helper (autonormalize/classes.py:601) (88 samples, 0.10%)helper (autonormalize/classes.py:601) (88 samples, 0.10%)helper (autonormalize/classes.py:601) (85 samples, 0.10%)helper (autonormalize/classes.py:601) (76 samples, 0.09%)helper (autonormalize/classes.py:498) (100 samples, 0.12%)find_closure (autonormalize/classes.py:603) (98 samples, 0.11%)helper (autonormalize/classes.py:601) (97 samples, 0.11%)helper (autonormalize/classes.py:601) (93 samples, 0.11%)helper (autonormalize/classes.py:601) (91 samples, 0.11%)helper (autonormalize/classes.py:601) (86 samples, 0.10%)helper (autonormalize/classes.py:601) (84 samples, 0.10%)helper (autonormalize/classes.py:601) (79 samples, 0.09%)helper (autonormalize/classes.py:601) (77 samples, 0.09%)helper (autonormalize/classes.py:601) (76 samples, 0.09%)helper (autonormalize/classes.py:601) (74 samples, 0.09%)find_candidate_keys (autonormalize/classes.py:504) (333 samples, 0.39%)helper (autonormalize/classes.py:501) (333 samples, 0.39%)helper (autonormalize/classes.py:501) (333 samples, 0.39%)helper (autonormalize/classes.py:501) (325 samples, 0.38%)helper (autonormalize/classes.py:501) (301 samples, 0.35%)helper (autonormalize/classes.py:501) (238 samples, 0.28%)helper (autonormalize/classes.py:501) (141 samples, 0.16%)find_candidate_keys (autonormalize/classes.py:507) (110 samples, 0.13%)remove_part_deps (autonormalize/normalize.py:52) (534 samples, 0.62%)find_partial_deps (autonormalize/classes.py:532) (534 samples, 0.62%)find_candidate_keys (autonormalize/classes.py:510) (78 samples, 0.09%)<module> (pyspy2.py:66) (535 samples, 0.62%)normalize_dependencies (autonormalize/user_interaction.py:46) (535 samples, 0.62%)normalize (autonormalize/normalize.py:33) (535 samples, 0.62%)_convert_slice_indexer (pandas/core/indexing.py:266) (132 samples, 0.15%)_get_slice_axis (pandas/core/indexing.py:2178) (245 samples, 0.28%)_convert_slice_indexer (pandas/core/indexing.py:267) (100 samples, 0.12%)getitem_block (pandas/core/internals/blocks.py:295) (78 samples, 0.09%)get_slice (pandas/core/internals/managers.py:694) (428 samples, 0.50%)<listcomp> (pandas/core/internals/managers.py:694) (409 samples, 0.47%)getitem_block (pandas/core/internals/blocks.py:302) (207 samples, 0.24%)make_block_same_class (pandas/core/internals/blocks.py:235) (185 samples, 0.21%)make_block (pandas/core/internals/blocks.py:3095) (157 samples, 0.18%)__getitem__ (pandas/core/indexes/base.py:3956) (97 samples, 0.11%)__new__ (pandas/core/indexes/base.py:266) (111 samples, 0.13%)__new__ (pandas/core/indexes/base.py:285) (87 samples, 0.10%)is_interval_dtype (pandas/core/dtypes/common.py:569) (82 samples, 0.09%)__new__ (pandas/core/indexes/base.py:292) (123 samples, 0.14%)__new__ (pandas/core/indexes/base.py:403) (109 samples, 0.13%)get_slice (pandas/core/internals/managers.py:697) (1,447 samples, 1.67%)__getitem__ (pandas/core/indexes/base.py:3963) (1,312 samples, 1.52%)_shallow_copy (pandas/core/indexes/numeric.py:71) (1,274 samples, 1.47%)_shallow_copy_with_infer (pandas/core/indexes/base.py:607) (1,163 samples, 1.35%)__new__ (pandas/core/indexes/base.py:404) (303 samples, 0.35%)__new__ (pandas/core/indexes/numeric.py:58) (151 samples, 0.17%)_name_get (numpy/core/_dtype.py:334) (143 samples, 0.17%)_consolidate_check (pandas/core/internals/managers.py:600) (627 samples, 0.73%)<listcomp> (pandas/core/internals/managers.py:600) (615 samples, 0.71%)ftype (pandas/core/internals/blocks.py:318) (559 samples, 0.65%)__str__ (numpy/core/_dtype.py:54) (279 samples, 0.32%)__init__ (pandas/core/internals/managers.py:116) (665 samples, 0.77%)_rebuild_blknos_and_blklocs (pandas/core/internals/managers.py:190) (178 samples, 0.21%)shape (pandas/core/internals/managers.py:141) (88 samples, 0.10%)_rebuild_blknos_and_blklocs (pandas/core/internals/managers.py:191) (86 samples, 0.10%)_rebuild_blknos_and_blklocs (pandas/core/internals/managers.py:197) (77 samples, 0.09%)_rebuild_blknos_and_blklocs (pandas/core/internals/managers.py:198) (134 samples, 0.16%)_rebuild_blknos_and_blklocs (pandas/core/internals/managers.py:200) (278 samples, 0.32%)_any (numpy/core/_methods.py:43) (136 samples, 0.16%)__init__ (pandas/core/internals/managers.py:118) (852 samples, 0.99%)get_slice (pandas/core/internals/managers.py:699) (1,628 samples, 1.88%)g.._slice (pandas/core/generic.py:3162) (3,796 samples, 4.39%)_slic..get_iterator (pandas/core/groupby/ops.py:145) (4,486 samples, 5.19%)get_it..__iter__ (pandas/core/groupby/ops.py:828) (4,432 samples, 5.13%)__iter.._chop (pandas/core/groupby/ops.py:864) (4,395 samples, 5.09%)_chop ..__getitem__ (pandas/core/indexing.py:1500) (4,306 samples, 4.98%)__geti.._getitem_axis (pandas/core/indexing.py:2210) (4,291 samples, 4.97%)_getit.._get_slice_axis (pandas/core/indexing.py:2180) (4,004 samples, 4.63%)_get_.._slice (pandas/core/indexing.py:151) (3,984 samples, 4.61%)_slic.._slice (pandas/core/generic.py:3168) (78 samples, 0.09%)drop_primary_dups (autonormalize/normalize.py:179) (4,677 samples, 5.41%)drop_pr.._getitem_axis (pandas/core/indexing.py:2215) (161 samples, 0.19%)_validate_integer (pandas/core/indexing.py:2137) (114 samples, 0.13%)_getitem_axis (pandas/core/indexing.py:2230) (128 samples, 0.15%)_ixs (pandas/core/frame.py:2845) (115 samples, 0.13%)find_common_type (pandas/core/dtypes/cast.py:1097) (97 samples, 0.11%)find_common_type (pandas/core/dtypes/cast.py:1112) (173 samples, 0.20%)<genexpr> (pandas/core/dtypes/cast.py:1112) (159 samples, 0.18%)_can_coerce_all (numpy/core/numerictypes.py:586) (156 samples, 0.18%)_can_coerce_all (numpy/core/numerictypes.py:587) (192 samples, 0.22%)<listcomp> (numpy/core/numerictypes.py:587) (75 samples, 0.09%)find_common_type (numpy/core/numerictypes.py:657) (426 samples, 0.49%)fast_xs (pandas/core/internals/managers.py:889) (993 samples, 1.15%)_interleaved_dtype (pandas/core/internals/managers.py:1884) (982 samples, 1.14%)find_common_type (pandas/core/dtypes/cast.py:1120) (497 samples, 0.58%)fast_xs (pandas/core/internals/managers.py:901) (121 samples, 0.14%)fast_xs (pandas/core/internals/managers.py:902) (113 samples, 0.13%)_ixs (pandas/core/frame.py:2851) (1,452 samples, 1.68%)_ixs (pandas/core/frame.py:2852) (123 samples, 0.14%)_ixs (pandas/core/frame.py:2860) (91 samples, 0.11%)_name_get (numpy/core/_dtype.py:334) (87 samples, 0.10%)_try_cast (pandas/core/internals/construction.py:688) (214 samples, 0.25%)maybe_castable (pandas/core/dtypes/cast.py:843) (196 samples, 0.23%)maybe_cast_to_datetime (pandas/core/dtypes/cast.py:965) (75 samples, 0.09%)_try_cast (pandas/core/internals/construction.py:697) (321 samples, 0.37%)is_extension_type (pandas/core/dtypes/common.py:1693) (86 samples, 0.10%)is_categorical (pandas/core/dtypes/common.py:291) (82 samples, 0.09%)_try_cast (pandas/core/internals/construction.py:704) (197 samples, 0.23%)sanitize_array (pandas/core/internals/construction.py:572) (940 samples, 1.09%)sanitize_array (pandas/core/internals/construction.py:673) (75 samples, 0.09%)__init__ (pandas/core/series.py:262) (1,200 samples, 1.39%)get_block_type (pandas/core/internals/blocks.py:3060) (146 samples, 0.17%)make_block (pandas/core/internals/blocks.py:3088) (377 samples, 0.44%)__init__ (pandas/core/internals/managers.py:1481) (550 samples, 0.64%)make_block (pandas/core/internals/blocks.py:3095) (140 samples, 0.16%)__init__ (pandas/core/internals/blocks.py:2631) (91 samples, 0.11%)__init__ (pandas/core/series.py:264) (615 samples, 0.71%)__setattr__ (pandas/core/generic.py:5079) (77 samples, 0.09%)__init__ (pandas/core/series.py:268) (138 samples, 0.16%)_ixs (pandas/core/frame.py:2861) (2,291 samples, 2.65%)_i..__getitem__ (pandas/core/indexing.py:1500) (4,557 samples, 5.27%)__geti.._getitem_axis (pandas/core/indexing.py:2232) (4,203 samples, 4.86%)_getit.._get_loc (pandas/core/indexing.py:146) (4,184 samples, 4.84%)_get_l..apply (pandas/core/frame.py:6477) (75 samples, 0.09%)apply (pandas/core/frame.py:6486) (167 samples, 0.19%)frame_apply (pandas/core/apply.py:31) (102 samples, 0.12%)get_result (pandas/core/apply.py:113) (114 samples, 0.13%)seterr (numpy/core/numeric.py:2737) (78 samples, 0.09%)__enter__ (numpy/core/numeric.py:3059) (188 samples, 0.22%)apply (pandas/core/series.py:3582) (273 samples, 0.32%)is_extension_type (pandas/core/dtypes/common.py:1693) (96 samples, 0.11%)is_categorical (pandas/core/dtypes/common.py:291) (91 samples, 0.11%)apply (pandas/core/series.py:3587) (248 samples, 0.29%)astype (pandas/core/generic.py:5658) (84 samples, 0.10%)is_categorical_astype (pandas/core/internals/blocks.py:156) (160 samples, 0.19%)is_categorical_dtype (pandas/core/dtypes/common.py:602) (152 samples, 0.18%)_astype (pandas/core/internals/blocks.py:568) (180 samples, 0.21%)_astype (pandas/core/internals/blocks.py:595) (138 samples, 0.16%)apply (pandas/core/internals/managers.py:395) (708 samples, 0.82%)astype (pandas/core/internals/blocks.py:534) (674 samples, 0.78%)_astype (pandas/core/internals/blocks.py:599) (242 samples, 0.28%)copy (pandas/core/internals/blocks.py:754) (184 samples, 0.21%)make_block_same_class (pandas/core/internals/blocks.py:235) (156 samples, 0.18%)make_block (pandas/core/internals/blocks.py:3095) (135 samples, 0.16%)__init__ (pandas/core/internals/blocks.py:2631) (75 samples, 0.09%)apply (pandas/core/internals/managers.py:396) (101 samples, 0.12%)astype (pandas/core/generic.py:5691) (1,047 samples, 1.21%)astype (pandas/core/internals/managers.py:531) (1,022 samples, 1.18%)__setattr__ (pandas/core/generic.py:5079) (76 samples, 0.09%)__init__ (pandas/core/series.py:268) (123 samples, 0.14%)astype (pandas/core/generic.py:5692) (483 samples, 0.56%)apply (pandas/core/series.py:3590) (1,799 samples, 2.08%)a..__exit__ (numpy/core/numeric.py:3064) (142 samples, 0.16%)is_dtype (pandas/core/dtypes/base.py:101) (146 samples, 0.17%)is_extension_type (pandas/core/dtypes/common.py:1693) (280 samples, 0.32%)is_categorical (pandas/core/dtypes/common.py:291) (269 samples, 0.31%)is_categorical_dtype (pandas/core/dtypes/common.py:602) (185 samples, 0.21%)is_sparse (pandas/core/dtypes/common.py:216) (163 samples, 0.19%)_handle_fromlist (<frozen importlib._bootstrap>:1019) (102 samples, 0.12%)is_extension_type (pandas/core/dtypes/common.py:1695) (206 samples, 0.24%)is_dtype (pandas/core/dtypes/base.py:101) (153 samples, 0.18%)is_extension_type (pandas/core/dtypes/common.py:1697) (200 samples, 0.23%)is_datetime64tz_dtype (pandas/core/dtypes/common.py:469) (188 samples, 0.22%)apply (pandas/core/series.py:3591) (1,654 samples, 1.91%)a.._name_get (numpy/core/_dtype.py:334) (96 samples, 0.11%)_try_cast (pandas/core/internals/construction.py:688) (242 samples, 0.28%)maybe_castable (pandas/core/dtypes/cast.py:843) (223 samples, 0.26%)sanitize_array (pandas/core/internals/construction.py:582) (247 samples, 0.29%)__init__ (pandas/core/series.py:262) (447 samples, 0.52%)get_block_type (pandas/core/internals/blocks.py:3050) (77 samples, 0.09%)get_block_type (pandas/core/internals/blocks.py:3053) (86 samples, 0.10%)is_categorical (pandas/core/dtypes/common.py:291) (81 samples, 0.09%)is_interval_dtype (pandas/core/dtypes/common.py:569) (83 samples, 0.10%)get_block_type (pandas/core/internals/blocks.py:3060) (162 samples, 0.19%)make_block (pandas/core/internals/blocks.py:3088) (453 samples, 0.52%)__init__ (pandas/core/internals/managers.py:1481) (591 samples, 0.68%)make_block (pandas/core/internals/blocks.py:3095) (108 samples, 0.13%)__init__ (pandas/core/series.py:264) (652 samples, 0.75%)__setattr__ (pandas/core/generic.py:5079) (74 samples, 0.09%)__init__ (pandas/core/series.py:268) (129 samples, 0.15%)apply (pandas/core/series.py:3598) (1,562 samples, 1.81%)get_dtypes (pandas/core/internals/managers.py:226) (226 samples, 0.26%)take_nd (pandas/core/algorithms.py:1588) (85 samples, 0.10%)is_interval_dtype (pandas/core/dtypes/common.py:569) (80 samples, 0.09%)_name_get (numpy/core/_dtype.py:334) (126 samples, 0.15%)_get_take_nd_function (pandas/core/algorithms.py:1419) (295 samples, 0.34%)take_nd (pandas/core/algorithms.py:1654) (356 samples, 0.41%)dtypes (pandas/core/generic.py:5490) (1,298 samples, 1.50%)get_dtypes (pandas/core/internals/managers.py:227) (1,023 samples, 1.18%)take_nd (pandas/core/algorithms.py:1655) (172 samples, 0.20%)_validate_dtype (pandas/core/generic.py:182) (92 samples, 0.11%)__init__ (pandas/core/series.py:174) (109 samples, 0.13%)_try_cast (pandas/core/internals/construction.py:688) (185 samples, 0.21%)maybe_castable (pandas/core/dtypes/cast.py:843) (160 samples, 0.19%)_try_cast (pandas/core/internals/construction.py:697) (293 samples, 0.34%)_try_cast (pandas/core/internals/construction.py:700) (74 samples, 0.09%)_try_cast (pandas/core/internals/construction.py:704) (165 samples, 0.19%)sanitize_array (pandas/core/internals/construction.py:572) (842 samples, 0.97%)sanitize_array (pandas/core/internals/construction.py:673) (86 samples, 0.10%)__init__ (pandas/core/series.py:262) (1,161 samples, 1.34%)get_block_type (pandas/core/internals/blocks.py:3060) (142 samples, 0.16%)make_block (pandas/core/internals/blocks.py:3088) (355 samples, 0.41%)__init__ (pandas/core/internals/managers.py:1481) (536 samples, 0.62%)make_block (pandas/core/internals/blocks.py:3095) (141 samples, 0.16%)__init__ (pandas/core/internals/blocks.py:2631) (92 samples, 0.11%)__init__ (pandas/core/series.py:264) (599 samples, 0.69%)__setattr__ (pandas/core/generic.py:5079) (78 samples, 0.09%)__init__ (pandas/core/series.py:268) (119 samples, 0.14%)dtypes (pandas/core/apply.py:103) (3,619 samples, 4.19%)dtyp..dtypes (pandas/core/generic.py:5491) (2,256 samples, 2.61%)dt.._reduce (pandas/core/series.py:3620) (82 samples, 0.09%)is_datetime64_dtype (pandas/core/dtypes/common.py:431) (76 samples, 0.09%)__enter__ (numpy/core/numeric.py:3059) (124 samples, 0.14%)_reduce (pandas/core/series.py:3629) (188 samples, 0.22%)__exit__ (numpy/core/numeric.py:3064) (117 samples, 0.14%)_isna_new (pandas/core/dtypes/missing.py:106) (109 samples, 0.13%)_isna_ndarraylike (pandas/core/dtypes/missing.py:216) (192 samples, 0.22%)needs_i8_conversion (pandas/core/dtypes/common.py:1469) (84 samples, 0.10%)is_period_dtype (pandas/core/dtypes/common.py:533) (80 samples, 0.09%)_isna_ndarraylike (pandas/core/dtypes/missing.py:220) (128 samples, 0.15%)_get_values (pandas/core/nanops.py:223) (665 samples, 0.77%)isna (pandas/core/dtypes/missing.py:99) (659 samples, 0.76%)_isna_new (pandas/core/dtypes/missing.py:114) (494 samples, 0.57%)_get_values (pandas/core/nanops.py:225) (129 samples, 0.15%)_get_values (pandas/core/nanops.py:253) (138 samples, 0.16%)nanany (pandas/core/nanops.py:366) (1,172 samples, 1.36%)apply_standard (pandas/core/apply.py:237) (11,418 samples, 13.22%)apply_standard (pand..logical_func (pandas/core/generic.py:11032) (1,878 samples, 2.17%)l.._reduce (pandas/core/series.py:3630) (1,499 samples, 1.74%)nanany (pandas/core/nanops.py:367) (152 samples, 0.18%)_any (numpy/core/_methods.py:43) (139 samples, 0.16%)values (pandas/core/generic.py:5324) (115 samples, 0.13%)_consolidate_inplace (pandas/core/generic.py:5138) (94 samples, 0.11%)find_common_type (pandas/core/dtypes/cast.py:1097) (76 samples, 0.09%)find_common_type (pandas/core/dtypes/cast.py:1112) (163 samples, 0.19%)<genexpr> (pandas/core/dtypes/cast.py:1112) (149 samples, 0.17%)_can_coerce_all (numpy/core/numerictypes.py:586) (156 samples, 0.18%)_can_coerce_all (numpy/core/numerictypes.py:587) (176 samples, 0.20%)find_common_type (numpy/core/numerictypes.py:657) (404 samples, 0.47%)_interleave (pandas/core/internals/managers.py:778) (905 samples, 1.05%)_interleaved_dtype (pandas/core/internals/managers.py:1884) (891 samples, 1.03%)find_common_type (pandas/core/dtypes/cast.py:1120) (465 samples, 0.54%)_interleave (pandas/core/internals/managers.py:787) (119 samples, 0.14%)_interleave (pandas/core/internals/managers.py:789) (88 samples, 0.10%)get_values (pandas/core/internals/blocks.py:180) (86 samples, 0.10%)is_object_dtype (pandas/core/dtypes/common.py:157) (75 samples, 0.09%)_interleave (pandas/core/internals/managers.py:793) (425 samples, 0.49%)get_values (pandas/core/internals/blocks.py:181) (249 samples, 0.29%)_interleave (pandas/core/internals/managers.py:794) (82 samples, 0.09%)as_array (pandas/core/internals/managers.py:768) (1,995 samples, 2.31%)a.._interleave (pandas/core/internals/managers.py:796) (156 samples, 0.18%)_all (numpy/core/_methods.py:46) (142 samples, 0.16%)apply_standard (pandas/core/apply.py:241) (2,277 samples, 2.64%)ap..values (pandas/core/apply.py:99) (2,246 samples, 2.60%)va..values (pandas/core/generic.py:5325) (2,110 samples, 2.44%)va..apply_standard (pandas/core/apply.py:242) (88 samples, 0.10%)apply_standard (pandas/core/apply.py:244) (86 samples, 0.10%)__init__ (pandas/core/series.py:240) (83 samples, 0.10%)_try_cast (pandas/core/internals/construction.py:688) (220 samples, 0.25%)maybe_castable (pandas/core/dtypes/cast.py:843) (205 samples, 0.24%)_try_cast (pandas/core/internals/construction.py:697) (292 samples, 0.34%)_try_cast (pandas/core/internals/construction.py:700) (79 samples, 0.09%)_try_cast (pandas/core/internals/construction.py:704) (155 samples, 0.18%)sanitize_array (pandas/core/internals/construction.py:572) (870 samples, 1.01%)__init__ (pandas/core/series.py:262) (1,127 samples, 1.30%)get_block_type (pandas/core/internals/blocks.py:3053) (83 samples, 0.10%)is_categorical (pandas/core/dtypes/common.py:291) (78 samples, 0.09%)get_block_type (pandas/core/internals/blocks.py:3060) (149 samples, 0.17%)make_block (pandas/core/internals/blocks.py:3088) (394 samples, 0.46%)__init__ (pandas/core/internals/managers.py:1481) (573 samples, 0.66%)make_block (pandas/core/internals/blocks.py:3095) (145 samples, 0.17%)__init__ (pandas/core/internals/blocks.py:2631) (93 samples, 0.11%)__init__ (pandas/core/series.py:264) (654 samples, 0.76%)__setattr__ (pandas/core/generic.py:5079) (93 samples, 0.11%)__init__ (pandas/core/series.py:268) (146 samples, 0.17%)apply_standard (pandas/core/apply.py:245) (2,255 samples, 2.61%)ap.._name_get (numpy/core/_dtype.py:334) (76 samples, 0.09%)_try_cast (pandas/core/internals/construction.py:688) (226 samples, 0.26%)maybe_castable (pandas/core/dtypes/cast.py:843) (211 samples, 0.24%)maybe_cast_to_datetime (pandas/core/dtypes/cast.py:1067) (309 samples, 0.36%)_try_cast (pandas/core/internals/construction.py:697) (459 samples, 0.53%)_try_cast (pandas/core/internals/construction.py:704) (170 samples, 0.20%)sanitize_array (pandas/core/internals/construction.py:582) (962 samples, 1.11%)sanitize_array (pandas/core/internals/construction.py:674) (288 samples, 0.33%)__init__ (pandas/core/series.py:262) (1,412 samples, 1.63%)is_interval_dtype (pandas/core/dtypes/common.py:569) (76 samples, 0.09%)get_block_type (pandas/core/internals/blocks.py:3060) (143 samples, 0.17%)make_block (pandas/core/internals/blocks.py:3088) (381 samples, 0.44%)__init__ (pandas/core/internals/managers.py:1481) (539 samples, 0.62%)make_block (pandas/core/internals/blocks.py:3095) (129 samples, 0.15%)__init__ (pandas/core/internals/blocks.py:2631) (85 samples, 0.10%)__init__ (pandas/core/series.py:264) (592 samples, 0.69%)__init__ (pandas/core/series.py:268) (121 samples, 0.14%)_ensure_arraylike (pandas/core/algorithms.py:167) (115 samples, 0.13%)is_array_like (pandas/core/dtypes/inference.py:334) (109 samples, 0.13%)mode (pandas/core/algorithms.py:809) (122 samples, 0.14%)is_datetime64_dtype (pandas/core/dtypes/common.py:431) (103 samples, 0.12%)is_datetimelike (pandas/core/dtypes/common.py:741) (184 samples, 0.21%)mode (pandas/core/algorithms.py:818) (280 samples, 0.32%)_ensure_data (pandas/core/algorithms.py:67) (147 samples, 0.17%)_ensure_data (pandas/core/algorithms.py:71) (113 samples, 0.13%)is_signed_integer_dtype (pandas/core/dtypes/common.py:977) (104 samples, 0.12%)_ensure_data (pandas/core/algorithms.py:73) (74 samples, 0.09%)_ensure_data (pandas/core/algorithms.py:76) (87 samples, 0.10%)is_float_dtype (pandas/core/dtypes/common.py:1575) (80 samples, 0.09%)__init__ (pandas/core/arrays/numpy_.py:38) (143 samples, 0.17%)array (pandas/core/base.py:862) (241 samples, 0.28%)__init__ (pandas/core/arrays/numpy_.py:140) (177 samples, 0.20%)__array__ (pandas/core/series.py:716) (521 samples, 0.60%)__init__ (pandas/core/arrays/numpy_.py:38) (129 samples, 0.15%)array (pandas/core/base.py:862) (175 samples, 0.20%)__init__ (pandas/core/arrays/numpy_.py:140) (151 samples, 0.17%)__array__ (pandas/core/series.py:728) (488 samples, 0.56%)asarray (numpy/core/numeric.py:538) (128 samples, 0.15%)mode (pandas/core/algorithms.py:822) (1,771 samples, 2.05%)m.._ensure_data (pandas/core/algorithms.py:79) (1,232 samples, 1.43%)asarray (numpy/core/numeric.py:538) (1,204 samples, 1.39%)mode (pandas/core/algorithms.py:825) (237 samples, 0.27%)mode (pandas/core/algorithms.py:827) (149 samples, 0.17%)_reconstruct_data (pandas/core/algorithms.py:149) (149 samples, 0.17%)is_period_dtype (pandas/core/dtypes/common.py:533) (76 samples, 0.09%)mode (pandas/core/algorithms.py:831) (410 samples, 0.47%)__new__ (pandas/core/indexes/range.py:123) (103 samples, 0.12%)__init__ (pandas/core/series.py:239) (310 samples, 0.36%)default_index (pandas/core/indexes/base.py:5410) (250 samples, 0.29%)_try_cast (pandas/core/internals/construction.py:688) (186 samples, 0.22%)maybe_castable (pandas/core/dtypes/cast.py:843) (167 samples, 0.19%)maybe_cast_to_datetime (pandas/core/dtypes/cast.py:1067) (265 samples, 0.31%)_try_cast (pandas/core/internals/construction.py:697) (390 samples, 0.45%)is_extension_type (pandas/core/dtypes/common.py:1693) (81 samples, 0.09%)is_categorical (pandas/core/dtypes/common.py:291) (80 samples, 0.09%)_try_cast (pandas/core/internals/construction.py:704) (176 samples, 0.20%)sanitize_array (pandas/core/internals/construction.py:582) (850 samples, 0.98%)sanitize_array (pandas/core/internals/construction.py:674) (258 samples, 0.30%)__init__ (pandas/core/series.py:262) (1,297 samples, 1.50%)get_block_type (pandas/core/internals/blocks.py:3060) (116 samples, 0.13%)make_block (pandas/core/internals/blocks.py:3088) (370 samples, 0.43%)__init__ (pandas/core/internals/managers.py:1481) (564 samples, 0.65%)make_block (pandas/core/internals/blocks.py:3095) (146 samples, 0.17%)__init__ (pandas/core/internals/blocks.py:2631) (93 samples, 0.11%)__init__ (pandas/core/series.py:264) (634 samples, 0.73%)__init__ (pandas/core/series.py:268) (121 samples, 0.14%)f (pandas/core/frame.py:7693) (5,757 samples, 6.66%)f (pandas..mode (pandas/core/series.py:1610) (5,747 samples, 6.65%)mode (pan..mode (pandas/core/algorithms.py:832) (2,569 samples, 2.97%)mo..apply_standard (pandas/core/apply.py:251) (8,848 samples, 10.24%)apply_standard ..values (pandas/core/series.py:474) (115 samples, 0.13%)external_values (pandas/core/internals/managers.py:1547) (85 samples, 0.10%)apply_series_generator (pandas/core/apply.py:263) (117 samples, 0.14%)series_generator (pandas/core/apply.py:326) (89 samples, 0.10%)__getitem__ (pandas/core/indexes/base.py:3957) (108 samples, 0.13%)_ixs (pandas/core/frame.py:2867) (375 samples, 0.43%)__getitem__ (pandas/core/indexes/base.py:3958) (75 samples, 0.09%)_ixs (pandas/core/frame.py:2876) (119 samples, 0.14%)iget (pandas/core/internals/managers.py:969) (133 samples, 0.15%)iget (pandas/core/internals/managers.py:970) (163 samples, 0.19%)iget (pandas/core/internals/blocks.py:333) (89 samples, 0.10%)__init__ (pandas/core/internals/blocks.py:80) (84 samples, 0.10%)__init__ (pandas/core/internals/blocks.py:2631) (201 samples, 0.23%)iget (pandas/core/internals/managers.py:978) (650 samples, 0.75%)make_block_same_class (pandas/core/internals/blocks.py:235) (596 samples, 0.69%)make_block (pandas/core/internals/blocks.py:3095) (524 samples, 0.61%)__init__ (pandas/core/internals/managers.py:1445) (103 samples, 0.12%)__init__ (pandas/core/internals/managers.py:1464) (101 samples, 0.12%)_ixs (pandas/core/frame.py:2882) (1,513 samples, 1.75%)iget (pandas/core/internals/managers.py:979) (406 samples, 0.47%)_ixs (pandas/core/frame.py:2884) (166 samples, 0.19%)__len__ (pandas/core/internals/managers.py:292) (91 samples, 0.11%)__init__ (pandas/core/series.py:266) (176 samples, 0.20%)__setattr__ (pandas/core/generic.py:5079) (328 samples, 0.38%)name (pandas/core/series.py:397) (247 samples, 0.29%)__getattr__ (pandas/core/generic.py:5063) (77 samples, 0.09%)name (pandas/core/series.py:401) (82 samples, 0.09%)__setattr__ (pandas/core/generic.py:5089) (169 samples, 0.20%)__init__ (pandas/core/series.py:268) (624 samples, 0.72%)_set_axis (pandas/core/series.py:376) (74 samples, 0.09%)_ixs (pandas/core/frame.py:2886) (1,278 samples, 1.48%)_box_col_values (pandas/core/frame.py:3354) (1,179 samples, 1.36%)__init__ (pandas/core/series.py:269) (197 samples, 0.23%)__setattr__ (pandas/core/generic.py:5079) (88 samples, 0.10%)_ixs (pandas/core/frame.py:2889) (295 samples, 0.34%)_set_as_cached (pandas/core/generic.py:3074) (254 samples, 0.29%)apply_series_generator (pandas/core/apply.py:285) (4,185 samples, 4.84%)apply_..<genexpr> (pandas/core/apply.py:326) (3,951 samples, 4.57%)<gene..mode (pandas/core/algorithms.py:807) (264 samples, 0.31%)dtype (pandas/core/series.py:411) (134 samples, 0.16%)dtype (pandas/core/internals/managers.py:1524) (92 samples, 0.11%)is_list_like (pandas/core/dtypes/inference.py:293) (196 samples, 0.23%)__instancecheck__ (abc.py:139) (93 samples, 0.11%)_ensure_arraylike (pandas/core/algorithms.py:167) (531 samples, 0.61%)is_array_like (pandas/core/dtypes/inference.py:334) (502 samples, 0.58%)mode (pandas/core/algorithms.py:809) (570 samples, 0.66%)is_dtype (pandas/core/dtypes/base.py:101) (199 samples, 0.23%)_check (pandas/core/dtypes/generic.py:9) (88 samples, 0.10%)mode (pandas/core/algorithms.py:813) (413 samples, 0.48%)is_categorical_dtype (pandas/core/dtypes/common.py:602) (375 samples, 0.43%)is_dtype (pandas/core/dtypes/base.py:98) (108 samples, 0.13%)_is_dtype_type (pandas/core/dtypes/common.py:1874) (107 samples, 0.12%)dtype (pandas/core/series.py:411) (75 samples, 0.09%)_is_dtype_type (pandas/core/dtypes/common.py:1882) (101 samples, 0.12%)is_datetime64_dtype (pandas/core/dtypes/common.py:431) (492 samples, 0.57%)is_dtype (pandas/core/dtypes/base.py:101) (167 samples, 0.19%)_check (pandas/core/dtypes/generic.py:9) (76 samples, 0.09%)is_datetimelike (pandas/core/dtypes/common.py:741) (847 samples, 0.98%)is_datetime64tz_dtype (pandas/core/dtypes/common.py:469) (311 samples, 0.36%)is_dtype (pandas/core/dtypes/base.py:98) (103 samples, 0.12%)_is_dtype_type (pandas/core/dtypes/common.py:1874) (92 samples, 0.11%)_is_dtype_type (pandas/core/dtypes/common.py:1875) (92 samples, 0.11%)is_datetimelike (pandas/core/dtypes/common.py:742) (421 samples, 0.49%)is_timedelta64_dtype (pandas/core/dtypes/common.py:500) (409 samples, 0.47%)mode (pandas/core/algorithms.py:818) (1,373 samples, 1.59%)is_datetimelike (pandas/core/dtypes/common.py:743) (76 samples, 0.09%)_ensure_data (pandas/core/algorithms.py:65) (170 samples, 0.20%)is_object_dtype (pandas/core/dtypes/common.py:157) (141 samples, 0.16%)_get_dtype (pandas/core/dtypes/common.py:1839) (105 samples, 0.12%)_get_dtype (pandas/core/dtypes/common.py:1840) (74 samples, 0.09%)is_bool_dtype (pandas/core/dtypes/common.py:1620) (316 samples, 0.37%)is_bool_dtype (pandas/core/dtypes/common.py:1628) (99 samples, 0.11%)is_extension_array_dtype (pandas/core/dtypes/common.py:1747) (99 samples, 0.11%)is_bool_dtype (pandas/core/dtypes/common.py:1636) (280 samples, 0.32%)is_extension_array_dtype (pandas/core/dtypes/common.py:1749) (149 samples, 0.17%)_ensure_data (pandas/core/algorithms.py:67) (785 samples, 0.91%)_is_dtype_type (pandas/core/dtypes/common.py:1874) (93 samples, 0.11%)_is_dtype_type (pandas/core/dtypes/common.py:1875) (78 samples, 0.09%)_ensure_data (pandas/core/algorithms.py:71) (506 samples, 0.59%)is_signed_integer_dtype (pandas/core/dtypes/common.py:977) (462 samples, 0.53%)array (pandas/core/base.py:861) (110 samples, 0.13%)issubdtype (numpy/core/numerictypes.py:392) (77 samples, 0.09%)_name_get (numpy/core/_dtype.py:334) (139 samples, 0.16%)__init__ (pandas/core/arrays/numpy_.py:38) (331 samples, 0.38%)array (pandas/core/base.py:862) (460 samples, 0.53%)__init__ (pandas/core/arrays/numpy_.py:140) (387 samples, 0.45%)__array__ (pandas/core/series.py:728) (1,165 samples, 1.35%)asarray (numpy/core/numeric.py:538) (273 samples, 0.32%)_ensure_data (pandas/core/algorithms.py:72) (1,687 samples, 1.95%)_.._ensure_data (pandas/core/algorithms.py:73) (248 samples, 0.29%)is_unsigned_integer_dtype (pandas/core/dtypes/common.py:1025) (239 samples, 0.28%)_ensure_data (pandas/core/algorithms.py:76) (312 samples, 0.36%)is_float_dtype (pandas/core/dtypes/common.py:1575) (294 samples, 0.34%)_ensure_data (pandas/core/algorithms.py:78) (240 samples, 0.28%)is_object_dtype (pandas/core/dtypes/common.py:157) (228 samples, 0.26%)array (pandas/core/base.py:851) (90 samples, 0.10%)array (pandas/core/base.py:853) (119 samples, 0.14%)array (pandas/core/base.py:856) (100 samples, 0.12%)is_timedelta64_ns_dtype (pandas/core/dtypes/common.py:1195) (83 samples, 0.10%)array (pandas/core/base.py:860) (127 samples, 0.15%)is_extension_array_dtype (pandas/core/dtypes/common.py:1749) (80 samples, 0.09%)_handle_fromlist (<frozen importlib._bootstrap>:1019) (77 samples, 0.09%)array (pandas/core/base.py:861) (156 samples, 0.18%)issubdtype (numpy/core/numerictypes.py:392) (106 samples, 0.12%)_name_get (numpy/core/_dtype.py:334) (193 samples, 0.22%)__init__ (pandas/core/arrays/numpy_.py:38) (499 samples, 0.58%)array (pandas/core/base.py:862) (689 samples, 0.80%)__init__ (pandas/core/arrays/numpy_.py:140) (588 samples, 0.68%)__array__ (pandas/core/series.py:716) (1,413 samples, 1.64%)array (pandas/core/base.py:851) (91 samples, 0.11%)array (pandas/core/base.py:860) (92 samples, 0.11%)array (pandas/core/base.py:861) (130 samples, 0.15%)issubdtype (numpy/core/numerictypes.py:392) (99 samples, 0.11%)_name_get (numpy/core/_dtype.py:334) (170 samples, 0.20%)__init__ (pandas/core/arrays/numpy_.py:38) (401 samples, 0.46%)array (pandas/core/base.py:862) (571 samples, 0.66%)__init__ (pandas/core/arrays/numpy_.py:140) (478 samples, 0.55%)__array__ (pandas/core/series.py:728) (1,433 samples, 1.66%)asarray (numpy/core/numeric.py:538) (359 samples, 0.42%)mode (pandas/core/algorithms.py:822) (7,559 samples, 8.75%)mode (pandas.._ensure_data (pandas/core/algorithms.py:79) (3,494 samples, 4.04%)_ens..asarray (numpy/core/numeric.py:538) (3,416 samples, 3.95%)asar..__getattr__ (pandas/core/generic.py:5063) (118 samples, 0.14%)mode (pandas/core/algorithms.py:824) (251 samples, 0.29%)mode (pandas/core/algorithms.py:825) (1,079 samples, 1.25%)sort (numpy/core/fromnumeric.py:933) (301 samples, 0.35%)sort (numpy/core/fromnumeric.py:934) (176 samples, 0.20%)mode (pandas/core/algorithms.py:827) (684 samples, 0.79%)_reconstruct_data (pandas/core/algorithms.py:146) (244 samples, 0.28%)_reconstruct_data (pandas/core/algorithms.py:147) (217 samples, 0.25%)is_extension_array_dtype (pandas/core/dtypes/common.py:1749) (144 samples, 0.17%)is_dtype (pandas/core/dtypes/base.py:101) (202 samples, 0.23%)_check (pandas/core/dtypes/generic.py:9) (89 samples, 0.10%)is_datetime64tz_dtype (pandas/core/dtypes/common.py:469) (297 samples, 0.34%)is_dtype (pandas/core/dtypes/base.py:101) (152 samples, 0.18%)_reconstruct_data (pandas/core/algorithms.py:149) (730 samples, 0.84%)is_period_dtype (pandas/core/dtypes/common.py:533) (377 samples, 0.44%)is_dtype (pandas/core/dtypes/dtypes.py:847) (291 samples, 0.34%)is_bool_dtype (pandas/core/dtypes/common.py:1636) (136 samples, 0.16%)is_extension_array_dtype (pandas/core/dtypes/common.py:1749) (90 samples, 0.10%)_reconstruct_data (pandas/core/algorithms.py:151) (332 samples, 0.38%)_reconstruct_data (pandas/core/algorithms.py:158) (129 samples, 0.15%)mode (pandas/core/algorithms.py:831) (1,944 samples, 2.25%)m..dtype (pandas/core/series.py:411) (179 samples, 0.21%)dtype (pandas/core/internals/managers.py:1524) (123 samples, 0.14%)is_list_like (pandas/core/dtypes/inference.py:293) (170 samples, 0.20%)__instancecheck__ (abc.py:139) (88 samples, 0.10%)__init__ (pandas/core/series.py:237) (292 samples, 0.34%)_handle_fromlist (<frozen importlib._bootstrap>:1019) (148 samples, 0.17%)default_index (pandas/core/indexes/base.py:5409) (264 samples, 0.31%)__new__ (pandas/core/indexes/range.py:104) (104 samples, 0.12%)__new__ (pandas/core/indexes/range.py:110) (143 samples, 0.17%)_simple_new (pandas/core/indexes/range.py:157) (166 samples, 0.19%)iteritems (pandas/compat/__init__.py:222) (90 samples, 0.10%)_simple_new (pandas/core/indexes/range.py:160) (96 samples, 0.11%)__new__ (pandas/core/indexes/range.py:123) (499 samples, 0.58%)__init__ (pandas/core/series.py:239) (1,379 samples, 1.60%)default_index (pandas/core/indexes/base.py:5410) (1,056 samples, 1.22%)extract_array (pandas/core/internals/arrays.py:49) (173 samples, 0.20%)_check (pandas/core/dtypes/generic.py:9) (78 samples, 0.09%)extract_array (pandas/core/internals/arrays.py:52) (84 samples, 0.10%)sanitize_array (pandas/core/internals/construction.py:555) (300 samples, 0.35%)issubclass_ (numpy/core/numerictypes.py:328) (112 samples, 0.13%)issubdtype (numpy/core/numerictypes.py:392) (182 samples, 0.21%)_name_get (numpy/core/_dtype.py:334) (308 samples, 0.36%)_try_cast (pandas/core/internals/construction.py:688) (906 samples, 1.05%)maybe_castable (pandas/core/dtypes/cast.py:843) (837 samples, 0.97%)_try_cast (pandas/core/internals/construction.py:694) (193 samples, 0.22%)is_integer_dtype (pandas/core/dtypes/common.py:920) (158 samples, 0.18%)maybe_infer_to_datetimelike (pandas/core/dtypes/cast.py:866) (261 samples, 0.30%)_check (pandas/core/dtypes/generic.py:9) (96 samples, 0.11%)is_list_like (pandas/core/dtypes/inference.py:293) (173 samples, 0.20%)__instancecheck__ (abc.py:139) (80 samples, 0.09%)maybe_infer_to_datetimelike (pandas/core/dtypes/cast.py:874) (289 samples, 0.33%)_is_dtype_type (pandas/core/dtypes/common.py:1882) (109 samples, 0.13%)maybe_infer_to_datetimelike (pandas/core/dtypes/cast.py:879) (336 samples, 0.39%)is_object_dtype (pandas/core/dtypes/common.py:157) (321 samples, 0.37%)maybe_infer_to_datetimelike (pandas/core/dtypes/cast.py:926) (195 samples, 0.23%)maybe_cast_to_datetime (pandas/core/dtypes/cast.py:1067) (1,374 samples, 1.59%)_handle_fromlist (<frozen importlib._bootstrap>:1019) (134 samples, 0.16%)maybe_cast_to_datetime (pandas/core/dtypes/cast.py:957) (244 samples, 0.28%)_handle_fromlist (<frozen importlib._bootstrap>:1019) (77 samples, 0.09%)maybe_cast_to_datetime (pandas/core/dtypes/cast.py:958) (150 samples, 0.17%)_try_cast (pandas/core/internals/construction.py:697) (1,967 samples, 2.28%)_.._try_cast (pandas/core/internals/construction.py:700) (131 samples, 0.15%)is_object_dtype (pandas/core/dtypes/common.py:157) (110 samples, 0.13%)is_dtype (pandas/core/dtypes/base.py:101) (164 samples, 0.19%)_check (pandas/core/dtypes/generic.py:9) (75 samples, 0.09%)is_extension_type (pandas/core/dtypes/common.py:1693) (369 samples, 0.43%)is_categorical (pandas/core/dtypes/common.py:291) (354 samples, 0.41%)is_categorical_dtype (pandas/core/dtypes/common.py:602) (238 samples, 0.28%)is_sparse (pandas/core/dtypes/common.py:216) (194 samples, 0.22%)_handle_fromlist (<frozen importlib._bootstrap>:1019) (102 samples, 0.12%)is_extension_type (pandas/core/dtypes/common.py:1695) (256 samples, 0.30%)is_dtype (pandas/core/dtypes/base.py:101) (165 samples, 0.19%)is_extension_type (pandas/core/dtypes/common.py:1697) (244 samples, 0.28%)is_datetime64tz_dtype (pandas/core/dtypes/common.py:469) (217 samples, 0.25%)_try_cast (pandas/core/internals/construction.py:704) (895 samples, 1.04%)_try_cast (pandas/core/internals/construction.py:706) (115 samples, 0.13%)sanitize_array (pandas/core/internals/construction.py:582) (4,246 samples, 4.91%)saniti..sanitize_array (pandas/core/internals/construction.py:652) (229 samples, 0.27%)__len__ (pandas/core/indexes/range.py:514) (148 samples, 0.17%)sanitize_array (pandas/core/internals/construction.py:673) (182 samples, 0.21%)is_object_dtype (pandas/core/dtypes/common.py:157) (134 samples, 0.16%)issubdtype (numpy/core/numerictypes.py:392) (91 samples, 0.11%)_name_get (numpy/core/_dtype.py:334) (171 samples, 0.20%)sanitize_array (pandas/core/internals/construction.py:674) (885 samples, 1.02%)__init__ (pandas/core/series.py:262) (6,135 samples, 7.10%)__init__ ..__len__ (pandas/core/indexes/range.py:514) (82 samples, 0.09%)_handle_fromlist (<frozen importlib._bootstrap>:1019) (135 samples, 0.16%)is_sparse (pandas/core/dtypes/common.py:216) (209 samples, 0.24%)get_block_type (pandas/core/internals/blocks.py:3050) (272 samples, 0.31%)is_dtype (pandas/core/dtypes/base.py:101) (162 samples, 0.19%)_check (pandas/core/dtypes/generic.py:9) (78 samples, 0.09%)get_block_type (pandas/core/internals/blocks.py:3053) (374 samples, 0.43%)is_categorical (pandas/core/dtypes/common.py:291) (353 samples, 0.41%)is_categorical_dtype (pandas/core/dtypes/common.py:602) (225 samples, 0.26%)is_dtype (pandas/core/dtypes/base.py:101) (146 samples, 0.17%)get_block_type (pandas/core/internals/blocks.py:3058) (212 samples, 0.25%)is_datetime64tz_dtype (pandas/core/dtypes/common.py:469) (186 samples, 0.22%)is_dtype (pandas/core/dtypes/base.py:101) (139 samples, 0.16%)is_interval_dtype (pandas/core/dtypes/common.py:569) (369 samples, 0.43%)is_dtype (pandas/core/dtypes/dtypes.py:991) (290 samples, 0.34%)is_dtype (pandas/core/dtypes/base.py:101) (140 samples, 0.16%)get_block_type (pandas/core/internals/blocks.py:3060) (694 samples, 0.80%)is_period_dtype (pandas/core/dtypes/common.py:533) (271 samples, 0.31%)is_dtype (pandas/core/dtypes/dtypes.py:847) (221 samples, 0.26%)get_block_type (pandas/core/internals/blocks.py:3062) (161 samples, 0.19%)is_extension_array_dtype (pandas/core/dtypes/common.py:1749) (100 samples, 0.12%)make_block (pandas/core/internals/blocks.py:3088) (1,935 samples, 2.24%)m..__init__ (pandas/core/internals/blocks.py:80) (86 samples, 0.10%)__init__ (pandas/core/internals/blocks.py:2631) (240 samples, 0.28%)__init__ (pandas/core/internals/managers.py:1481) (2,727 samples, 3.16%)__i..make_block (pandas/core/internals/blocks.py:3095) (557 samples, 0.64%)__init__ (pandas/core/series.py:264) (3,014 samples, 3.49%)__i..__init__ (pandas/core/generic.py:140) (82 samples, 0.09%)__init__ (pandas/core/series.py:266) (221 samples, 0.26%)__setattr__ (pandas/core/generic.py:5079) (359 samples, 0.42%)name (pandas/core/series.py:397) (269 samples, 0.31%)__getattr__ (pandas/core/generic.py:5063) (96 samples, 0.11%)__setattr__ (pandas/core/generic.py:5089) (108 samples, 0.13%)__init__ (pandas/core/series.py:268) (618 samples, 0.72%)_set_axis (pandas/core/series.py:376) (83 samples, 0.10%)apply_series_generator (pandas/core/apply.py:286) (26,534 samples, 30.71%)apply_series_generator (pandas/core/apply.py:286)f (pandas/core/frame.py:7693) (26,449 samples, 30.61%)f (pandas/core/frame.py:7693)mode (pandas/core/series.py:1610) (26,388 samples, 30.54%)mode (pandas/core/series.py:1610)mode (pandas/core/algorithms.py:832) (12,118 samples, 14.03%)mode (pandas/core/alg..__init__ (pandas/core/series.py:269) (217 samples, 0.25%)apply_series_generator (pandas/core/apply.py:287) (93 samples, 0.11%)apply_standard (pandas/core/apply.py:257) (31,076 samples, 35.97%)apply_standard (pandas/core/apply.py:257)is_datetime64_dtype (pandas/core/dtypes/common.py:431) (85 samples, 0.10%)is_datetimelike (pandas/core/dtypes/common.py:741) (147 samples, 0.17%)__iter__ (pandas/core/base.py:1126) (273 samples, 0.32%)is_sequence (pandas/core/dtypes/inference.py:495) (417 samples, 0.48%)__iter__ (pandas/core/base.py:1131) (77 samples, 0.09%)is_sequence (pandas/core/dtypes/inference.py:496) (77 samples, 0.09%)wrap_results (pandas/core/apply.py:306) (530 samples, 0.61%)__new__ (pandas/core/indexes/base.py:266) (117 samples, 0.14%)__new__ (pandas/core/indexes/base.py:279) (118 samples, 0.14%)is_categorical_dtype (pandas/core/dtypes/common.py:602) (101 samples, 0.12%)is_dtype (pandas/core/dtypes/base.py:112) (95 samples, 0.11%)construct_from_string (pandas/core/dtypes/dtypes.py:937) (77 samples, 0.09%)__new__ (pandas/core/indexes/base.py:285) (203 samples, 0.23%)is_interval_dtype (pandas/core/dtypes/common.py:569) (195 samples, 0.23%)is_dtype (pandas/core/dtypes/dtypes.py:991) (181 samples, 0.21%)is_datetime64_any_dtype (pandas/core/dtypes/common.py:1114) (103 samples, 0.12%)is_datetime64_dtype (pandas/core/dtypes/common.py:431) (99 samples, 0.11%)__new__ (pandas/core/indexes/base.py:292) (211 samples, 0.24%)is_datetime64_any_dtype (pandas/core/dtypes/common.py:1115) (96 samples, 0.11%)is_datetime64tz_dtype (pandas/core/dtypes/common.py:469) (94 samples, 0.11%)is_dtype (pandas/core/dtypes/base.py:112) (100 samples, 0.12%)__new__ (pandas/core/indexes/base.py:324) (175 samples, 0.20%)is_period_dtype (pandas/core/dtypes/common.py:533) (170 samples, 0.20%)is_dtype (pandas/core/dtypes/dtypes.py:847) (157 samples, 0.18%)__new__ (pandas/core/indexes/base.py:467) (87 samples, 0.10%)construct_1d_object_array_from_listlike (pandas/core/dtypes/cast.py:1213) (109 samples, 0.13%)__new__ (pandas/core/indexes/base.py:482) (271 samples, 0.31%)asarray_tuplesafe (pandas/core/common.py:230) (201 samples, 0.23%)construct_1d_object_array_from_listlike (pandas/core/dtypes/cast.py:1214) (79 samples, 0.09%)__new__ (pandas/core/indexes/base.py:266) (100 samples, 0.12%)__new__ (pandas/core/indexes/base.py:285) (82 samples, 0.09%)is_interval_dtype (pandas/core/dtypes/common.py:569) (78 samples, 0.09%)__new__ (pandas/core/indexes/base.py:292) (115 samples, 0.13%)__new__ (pandas/core/indexes/base.py:399) (74 samples, 0.09%)__new__ (pandas/core/indexes/base.py:411) (113 samples, 0.13%)asarray_tuplesafe (pandas/core/common.py:232) (127 samples, 0.15%)asarray (numpy/core/numeric.py:538) (116 samples, 0.13%)__new__ (pandas/core/indexes/base.py:414) (197 samples, 0.23%)__new__ (pandas/core/indexes/base.py:422) (285 samples, 0.33%)_try_convert_to_int_index (pandas/core/indexes/base.py:3773) (95 samples, 0.11%)_try_convert_to_int_index (pandas/core/indexes/base.py:3778) (121 samples, 0.14%)_try_convert_to_int_index (pandas/core/indexes/base.py:3779) (345 samples, 0.40%)_all (numpy/core/_methods.py:46) (155 samples, 0.18%)init_dict (pandas/core/internals/construction.py:209) (3,888 samples, 4.50%)init_..__new__ (pandas/core/indexes/base.py:483) (2,358 samples, 2.73%)__..__new__ (pandas/core/indexes/base.py:426) (968 samples, 1.12%)_try_convert_to_int_index (pandas/core/indexes/base.py:3780) (343 samples, 0.40%)__new__ (pandas/core/indexes/numeric.py:58) (170 samples, 0.20%)_union_indexes (pandas/core/indexes/api.py:152) (96 samples, 0.11%)is_list_like (pandas/core/dtypes/inference.py:293) (79 samples, 0.09%)_assert_can_do_setop (pandas/core/indexes/base.py:2591) (163 samples, 0.19%)union (pandas/core/indexes/range.py:453) (186 samples, 0.22%)union (pandas/core/indexes/range.py:454) (284 samples, 0.33%)_assert_can_do_setop (pandas/core/indexes/base.py:2591) (124 samples, 0.14%)union (pandas/core/indexes/base.py:2293) (135 samples, 0.16%)union (pandas/core/indexes/base.py:2296) (229 samples, 0.27%)get_op_result_name (pandas/core/ops.py:59) (92 samples, 0.11%)_get_reconciled_name_object (pandas/core/indexes/base.py:2244) (188 samples, 0.22%)extract_index (pandas/core/internals/construction.py:312) (1,417 samples, 1.64%)_union_indexes (pandas/core/indexes/api.py:183) (1,247 samples, 1.44%)union (pandas/core/indexes/range.py:455) (742 samples, 0.86%)union (pandas/core/indexes/base.py:2297) (211 samples, 0.24%)arrays_to_mgr (pandas/core/internals/construction.py:51) (1,598 samples, 1.85%)a.._homogenize (pandas/core/internals/construction.py:259) (83 samples, 0.10%)_construct_axes_from_arguments (pandas/core/generic.py:334) (94 samples, 0.11%)reindex (pandas/core/generic.py:4320) (245 samples, 0.28%)reindex (pandas/core/generic.py:4321) (86 samples, 0.10%)_protect_consolidate (pandas/core/generic.py:5127) (156 samples, 0.18%)f (pandas/core/generic.py:5136) (149 samples, 0.17%)reindex (pandas/core/generic.py:4337) (308 samples, 0.36%)_consolidate_inplace (pandas/core/generic.py:5138) (243 samples, 0.28%)_get_axis (pandas/core/generic.py:378) (79 samples, 0.09%)equals (pandas/core/indexes/range.py:335) (85 samples, 0.10%)identical (pandas/core/indexes/base.py:4076) (206 samples, 0.24%)identical (pandas/core/indexes/base.py:4078) (110 samples, 0.13%)reindex (pandas/core/generic.py:4342) (644 samples, 0.75%)<genexpr> (pandas/core/generic.py:4342) (558 samples, 0.65%)_homogenize (pandas/core/internals/construction.py:265) (1,584 samples, 1.83%)_..reindex (pandas/core/series.py:3738) (1,521 samples, 1.76%)arrays_to_mgr (pandas/core/internals/construction.py:56) (1,746 samples, 2.02%)a..form_blocks (pandas/core/internals/managers.py:1704) (106 samples, 0.12%)form_blocks (pandas/core/internals/managers.py:1709) (159 samples, 0.18%)form_blocks (pandas/core/internals/managers.py:1714) (232 samples, 0.27%)get_block_type (pandas/core/internals/blocks.py:3047) (138 samples, 0.16%)dtype (pandas/core/series.py:411) (97 samples, 0.11%)dtype (pandas/core/internals/managers.py:1524) (75 samples, 0.09%)_handle_fromlist (<frozen importlib._bootstrap>:1019) (146 samples, 0.17%)is_sparse (pandas/core/dtypes/common.py:216) (249 samples, 0.29%)get_block_type (pandas/core/internals/blocks.py:3050) (308 samples, 0.36%)is_dtype (pandas/core/dtypes/base.py:101) (172 samples, 0.20%)get_block_type (pandas/core/internals/blocks.py:3053) (478 samples, 0.55%)is_categorical (pandas/core/dtypes/common.py:291) (458 samples, 0.53%)is_categorical_dtype (pandas/core/dtypes/common.py:602) (340 samples, 0.39%)is_dtype (pandas/core/dtypes/base.py:98) (123 samples, 0.14%)dtype (pandas/core/series.py:411) (88 samples, 0.10%)is_dtype (pandas/core/dtypes/base.py:101) (139 samples, 0.16%)get_block_type (pandas/core/internals/blocks.py:3058) (293 samples, 0.34%)is_datetime64tz_dtype (pandas/core/dtypes/common.py:469) (273 samples, 0.32%)is_dtype (pandas/core/dtypes/base.py:98) (100 samples, 0.12%)dtype (pandas/core/series.py:411) (79 samples, 0.09%)is_dtype (pandas/core/dtypes/base.py:101) (149 samples, 0.17%)is_interval_dtype (pandas/core/dtypes/common.py:569) (337 samples, 0.39%)is_dtype (pandas/core/dtypes/dtypes.py:991) (271 samples, 0.31%)is_dtype (pandas/core/dtypes/base.py:101) (148 samples, 0.17%)_check (pandas/core/dtypes/generic.py:9) (74 samples, 0.09%)get_block_type (pandas/core/internals/blocks.py:3060) (663 samples, 0.77%)is_period_dtype (pandas/core/dtypes/common.py:533) (276 samples, 0.32%)is_dtype (pandas/core/dtypes/dtypes.py:847) (233 samples, 0.27%)is_extension_array_dtype (pandas/core/dtypes/common.py:1747) (119 samples, 0.14%)dtype (pandas/core/series.py:411) (88 samples, 0.10%)get_block_type (pandas/core/internals/blocks.py:3062) (285 samples, 0.33%)is_extension_array_dtype (pandas/core/dtypes/common.py:1749) (122 samples, 0.14%)form_blocks (pandas/core/internals/managers.py:1717) (2,358 samples, 2.73%)fo..form_blocks (pandas/core/internals/managers.py:1718) (99 samples, 0.11%)_stack_arrays (pandas/core/internals/managers.py:1856) (196 samples, 0.23%)_stack_arrays (pandas/core/internals/managers.py:1859) (119 samples, 0.14%)_shape_compat (pandas/core/internals/managers.py:1852) (80 samples, 0.09%)_stack_arrays (pandas/core/internals/managers.py:1863) (168 samples, 0.19%)_multi_blockify (pandas/core/internals/managers.py:1819) (614 samples, 0.71%)get_block_type (pandas/core/internals/blocks.py:3050) (78 samples, 0.09%)get_block_type (pandas/core/internals/blocks.py:3060) (140 samples, 0.16%)make_block (pandas/core/internals/blocks.py:3088) (392 samples, 0.45%)require (numpy/core/numeric.py:766) (126 samples, 0.15%)mgr_locs (pandas/core/internals/blocks.py:202) (373 samples, 0.43%)__init__ (pandas/core/internals/blocks.py:80) (398 samples, 0.46%)__init__ (pandas/core/internals/blocks.py:84) (111 samples, 0.13%)_multi_blockify (pandas/core/internals/managers.py:1821) (970 samples, 1.12%)make_block (pandas/core/internals/blocks.py:3095) (565 samples, 0.65%)form_blocks (pandas/core/internals/managers.py:1734) (1,720 samples, 1.99%)f.._stack_arrays (pandas/core/internals/managers.py:1859) (115 samples, 0.13%)_stack_arrays (pandas/core/internals/managers.py:1863) (200 samples, 0.23%)_simple_blockify (pandas/core/internals/managers.py:1800) (436 samples, 0.50%)get_block_type (pandas/core/internals/blocks.py:3050) (91 samples, 0.11%)get_block_type (pandas/core/internals/blocks.py:3053) (77 samples, 0.09%)is_categorical (pandas/core/dtypes/common.py:291) (77 samples, 0.09%)get_block_type (pandas/core/internals/blocks.py:3060) (116 samples, 0.13%)make_block (pandas/core/internals/blocks.py:3088) (391 samples, 0.45%)require (numpy/core/numeric.py:766) (91 samples, 0.11%)mgr_locs (pandas/core/internals/blocks.py:202) (235 samples, 0.27%)__init__ (pandas/core/internals/blocks.py:80) (259 samples, 0.30%)__init__ (pandas/core/internals/blocks.py:84) (79 samples, 0.09%)form_blocks (pandas/core/internals/managers.py:1754) (1,293 samples, 1.50%)_simple_blockify (pandas/core/internals/managers.py:1806) (833 samples, 0.96%)make_block (pandas/core/internals/blocks.py:3095) (420 samples, 0.49%)__init__ (pandas/core/internals/blocks.py:2631) (372 samples, 0.43%)create_block_manager_from_arrays (pandas/core/internals/managers.py:1666) (6,321 samples, 7.32%)create_blo.._verify_integrity (pandas/core/internals/managers.py:307) (110 samples, 0.13%)shape (pandas/core/internals/managers.py:141) (105 samples, 0.12%)__init__ (pandas/core/internals/managers.py:114) (258 samples, 0.30%)issubdtype (numpy/core/numerictypes.py:392) (87 samples, 0.10%)_name_get (numpy/core/_dtype.py:334) (173 samples, 0.20%)_consolidate_check (pandas/core/internals/managers.py:600) (735 samples, 0.85%)<listcomp> (pandas/core/internals/managers.py:600) (718 samples, 0.83%)ftype (pandas/core/internals/blocks.py:318) (661 samples, 0.77%)__str__ (numpy/core/_dtype.py:54) (331 samples, 0.38%)__init__ (pandas/core/internals/managers.py:116) (786 samples, 0.91%)_rebuild_blknos_and_blklocs (pandas/core/internals/managers.py:190) (172 samples, 0.20%)shape (pandas/core/internals/managers.py:141) (90 samples, 0.10%)_rebuild_blknos_and_blklocs (pandas/core/internals/managers.py:191) (104 samples, 0.12%)_rebuild_blknos_and_blklocs (pandas/core/internals/managers.py:197) (80 samples, 0.09%)_rebuild_blknos_and_blklocs (pandas/core/internals/managers.py:198) (144 samples, 0.17%)_rebuild_blknos_and_blklocs (pandas/core/internals/managers.py:200) (267 samples, 0.31%)_any (numpy/core/_methods.py:43) (140 samples, 0.16%)__init__ (pandas/core/internals/managers.py:118) (876 samples, 1.01%)create_block_manager_from_arrays (pandas/core/internals/managers.py:1667) (2,081 samples, 2.41%)cr..__init__ (pandas/core/frame.py:392) (15,904 samples, 18.41%)__init__ (pandas/core/frame...init_dict (pandas/core/internals/construction.py:212) (11,832 samples, 13.70%)init_dict (pandas/co..arrays_to_mgr (pandas/core/internals/construction.py:61) (8,447 samples, 9.78%)arrays_to_mgr ..wrap_results_for_axis (pandas/core/apply.py:340) (16,050 samples, 18.58%)wrap_results_for_axis (panda.._set_axis (pandas/core/generic.py:638) (95 samples, 0.11%)drop_primary_dups (autonormalize/normalize.py:180) (78,600 samples, 90.98%)drop_primary_dups (autonormalize/normalize.py:180)mode (pandas/core/frame.py:7695) (73,778 samples, 85.40%)mode (pandas/core/frame.py:7695)apply (pandas/core/frame.py:6487) (73,359 samples, 84.91%)apply (pandas/core/frame.py:6487)get_result (pandas/core/apply.py:151) (73,111 samples, 84.62%)get_result (pandas/core/apply.py:151)apply_standard (pandas/core/apply.py:260) (16,840 samples, 19.49%)apply_standard (pandas/core/ap..wrap_results (pandas/core/apply.py:308) (16,289 samples, 18.85%)wrap_results (pandas/core/app..wrap_results_for_axis (pandas/core/apply.py:349) (185 samples, 0.21%)__setattr__ (pandas/core/generic.py:5080) (145 samples, 0.17%)_list_of_series_to_arrays (pandas/core/internals/construction.py:456) (118 samples, 0.14%)take_nd (pandas/core/algorithms.py:1588) (87 samples, 0.10%)is_interval_dtype (pandas/core/dtypes/common.py:569) (84 samples, 0.10%)is_dtype (pandas/core/dtypes/dtypes.py:991) (78 samples, 0.09%)take_nd (pandas/core/algorithms.py:1591) (78 samples, 0.09%)take_nd (pandas/core/algorithms.py:1609) (232 samples, 0.27%)issubclass_ (numpy/core/numerictypes.py:328) (80 samples, 0.09%)issubdtype (numpy/core/numerictypes.py:392) (103 samples, 0.12%)_name_get (numpy/core/_dtype.py:334) (152 samples, 0.18%)_get_take_nd_function (pandas/core/algorithms.py:1419) (337 samples, 0.39%)take_nd (pandas/core/algorithms.py:1654) (369 samples, 0.43%)_list_of_series_to_arrays (pandas/core/internals/construction.py:457) (1,170 samples, 1.35%)take_nd (pandas/core/algorithms.py:1655) (111 samples, 0.13%)__init__ (pandas/core/frame.py:435) (1,394 samples, 1.61%)to_arrays (pandas/core/internals/construction.py:411) (1,394 samples, 1.61%)all (86,395 samples, 100%)<module> (pyspy2.py:68) (84,731 samples, 98.07%)<module> (pyspy2.py:68)split_dataframe (autonormalize/user_interaction.py:77) (84,727 samples, 98.07%)split_dataframe (autonormalize/user_interaction.py:77)drop_primary_dups (autonormalize/normalize.py:183) (1,412 samples, 1.63%) \ No newline at end of file diff --git a/autonormalize/tests/test_dfd.py b/autonormalize/tests/test_dfd.py index 3de4b54..1f1e832 100644 --- a/autonormalize/tests/test_dfd.py +++ b/autonormalize/tests/test_dfd.py @@ -42,11 +42,11 @@ def serialization_equal(dic_1, dic_2): def test_dfd(): dep = {"id": [], "age": [["height"], ["id"]], "height": [["age"], ["id"]], "less_than_5": [["age"], ["height"], ["id"]]} - assert_equal_dependency_dics(dfd.dfd(df_1, 0.98, 0.85).serialize(), dep) + assert_equal_dependency_dics(dfd.dfd(df_1, 0.98).serialize(), dep) dep = {"A": [], "B": [["A"]], "C": [["D", "G"], ["A"]], "D": [["C", "G"], ["A"]], "E": [["C"], ["D", "G"], ["A"]], "F": [["B"], ["A"]], "G": [["C", "D"], ["A"]]} - assert_equal_dependency_dics(dfd.dfd(df_2, 0.98, 0.90).serialize(), dep) + assert_equal_dependency_dics(dfd.dfd(df_2, 0.98).serialize(), dep) def test_compute_partitions(): @@ -57,20 +57,20 @@ def test_compute_partitions(): # c = [(a[i] + b[i])<4 for i in range(40)] c = [False, True, True, False, False, True, True, True, True, True, False, True, False, False, False, False, False, False, True, False, True, True, True, True, True, False, False, False, False, True, False, True, False, False, True, True, False, False, False, False] df = pd.DataFrame({'a': a, 'b': b, 'c': c}) - assert dfd.compute_partitions(df, 'c', frozenset(['a', 'b']), {}, 1.00, mask, 0.90) - assert dfd.compute_partitions(df, 'c', frozenset(['a', 'b']), {}, 0.90, mask, 0.90) + assert dfd.compute_partitions(df, 'c', frozenset(['a', 'b']), {}, 1.00, mask) + assert dfd.compute_partitions(df, 'c', frozenset(['a', 'b']), {}, 0.90, mask) - assert not dfd.compute_partitions(df, 'a', frozenset(['c']), {}, 1.00, mask, 0.90) - assert not dfd.compute_partitions(df, 'a', frozenset(['c']), {}, 0.90, mask, 0.90) + assert not dfd.compute_partitions(df, 'a', frozenset(['c']), {}, 1.00, mask) + assert not dfd.compute_partitions(df, 'a', frozenset(['c']), {}, 0.90, mask) c[0] = True df = pd.DataFrame({'a': a, 'b': b, 'c': c}) - assert dfd.compute_partitions(df, 'c', frozenset(['a', 'b']), {}, 0.97, mask, 0.90) - assert not dfd.compute_partitions(df, 'c', frozenset(['a', 'b']), {}, 0.98, mask, 0.90) + assert dfd.compute_partitions(df, 'c', frozenset(['a', 'b']), {}, 0.97, mask) + assert not dfd.compute_partitions(df, 'c', frozenset(['a', 'b']), {}, 0.98, mask) c[35] = False df = pd.DataFrame({'a': a, 'b': b, 'c': c}) - assert dfd.compute_partitions(df, 'c', frozenset(['a', 'b']), {}, 0.95, mask, 0.90) - assert not dfd.compute_partitions(df, 'c', frozenset(['a', 'b']), {}, 0.96, mask, 0.90) + assert dfd.compute_partitions(df, 'c', frozenset(['a', 'b']), {}, 0.95, mask) + assert not dfd.compute_partitions(df, 'c', frozenset(['a', 'b']), {}, 0.96, mask) # def test_approximate_dependencies():