teradataml 20.0.0.8__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- teradataml/LICENSE-3RD-PARTY.pdf +0 -0
- teradataml/LICENSE.pdf +0 -0
- teradataml/README.md +2762 -0
- teradataml/__init__.py +78 -0
- teradataml/_version.py +11 -0
- teradataml/analytics/Transformations.py +2996 -0
- teradataml/analytics/__init__.py +82 -0
- teradataml/analytics/analytic_function_executor.py +2416 -0
- teradataml/analytics/analytic_query_generator.py +1050 -0
- teradataml/analytics/byom/H2OPredict.py +514 -0
- teradataml/analytics/byom/PMMLPredict.py +437 -0
- teradataml/analytics/byom/__init__.py +16 -0
- teradataml/analytics/json_parser/__init__.py +133 -0
- teradataml/analytics/json_parser/analytic_functions_argument.py +1805 -0
- teradataml/analytics/json_parser/json_store.py +191 -0
- teradataml/analytics/json_parser/metadata.py +1666 -0
- teradataml/analytics/json_parser/utils.py +805 -0
- teradataml/analytics/meta_class.py +236 -0
- teradataml/analytics/sqle/DecisionTreePredict.py +456 -0
- teradataml/analytics/sqle/NaiveBayesPredict.py +420 -0
- teradataml/analytics/sqle/__init__.py +128 -0
- teradataml/analytics/sqle/json/decisiontreepredict_sqle.json +78 -0
- teradataml/analytics/sqle/json/naivebayespredict_sqle.json +62 -0
- teradataml/analytics/table_operator/__init__.py +11 -0
- teradataml/analytics/uaf/__init__.py +82 -0
- teradataml/analytics/utils.py +828 -0
- teradataml/analytics/valib.py +1617 -0
- teradataml/automl/__init__.py +5835 -0
- teradataml/automl/autodataprep/__init__.py +493 -0
- teradataml/automl/custom_json_utils.py +1625 -0
- teradataml/automl/data_preparation.py +1384 -0
- teradataml/automl/data_transformation.py +1254 -0
- teradataml/automl/feature_engineering.py +2273 -0
- teradataml/automl/feature_exploration.py +1873 -0
- teradataml/automl/model_evaluation.py +488 -0
- teradataml/automl/model_training.py +1407 -0
- teradataml/catalog/__init__.py +2 -0
- teradataml/catalog/byom.py +1759 -0
- teradataml/catalog/function_argument_mapper.py +859 -0
- teradataml/catalog/model_cataloging_utils.py +491 -0
- teradataml/clients/__init__.py +0 -0
- teradataml/clients/auth_client.py +137 -0
- teradataml/clients/keycloak_client.py +165 -0
- teradataml/clients/pkce_client.py +481 -0
- teradataml/common/__init__.py +1 -0
- teradataml/common/aed_utils.py +2078 -0
- teradataml/common/bulk_exposed_utils.py +113 -0
- teradataml/common/constants.py +1669 -0
- teradataml/common/deprecations.py +166 -0
- teradataml/common/exceptions.py +147 -0
- teradataml/common/formula.py +743 -0
- teradataml/common/garbagecollector.py +666 -0
- teradataml/common/logger.py +1261 -0
- teradataml/common/messagecodes.py +518 -0
- teradataml/common/messages.py +262 -0
- teradataml/common/pylogger.py +67 -0
- teradataml/common/sqlbundle.py +764 -0
- teradataml/common/td_coltype_code_to_tdtype.py +48 -0
- teradataml/common/utils.py +3166 -0
- teradataml/common/warnings.py +36 -0
- teradataml/common/wrapper_utils.py +625 -0
- teradataml/config/__init__.py +0 -0
- teradataml/config/dummy_file1.cfg +5 -0
- teradataml/config/dummy_file2.cfg +3 -0
- teradataml/config/sqlengine_alias_definitions_v1.0 +14 -0
- teradataml/config/sqlengine_alias_definitions_v1.1 +20 -0
- teradataml/config/sqlengine_alias_definitions_v1.3 +19 -0
- teradataml/context/__init__.py +0 -0
- teradataml/context/aed_context.py +223 -0
- teradataml/context/context.py +1462 -0
- teradataml/data/A_loan.csv +19 -0
- teradataml/data/BINARY_REALS_LEFT.csv +11 -0
- teradataml/data/BINARY_REALS_RIGHT.csv +11 -0
- teradataml/data/B_loan.csv +49 -0
- teradataml/data/BuoyData2.csv +17 -0
- teradataml/data/CONVOLVE2_COMPLEX_LEFT.csv +5 -0
- teradataml/data/CONVOLVE2_COMPLEX_RIGHT.csv +5 -0
- teradataml/data/Convolve2RealsLeft.csv +5 -0
- teradataml/data/Convolve2RealsRight.csv +5 -0
- teradataml/data/Convolve2ValidLeft.csv +11 -0
- teradataml/data/Convolve2ValidRight.csv +11 -0
- teradataml/data/DFFTConv_Real_8_8.csv +65 -0
- teradataml/data/Employee.csv +5 -0
- teradataml/data/Employee_Address.csv +4 -0
- teradataml/data/Employee_roles.csv +5 -0
- teradataml/data/JulesBelvezeDummyData.csv +100 -0
- teradataml/data/Mall_customer_data.csv +201 -0
- teradataml/data/Orders1_12mf.csv +25 -0
- teradataml/data/Pi_loan.csv +7 -0
- teradataml/data/SMOOTHED_DATA.csv +7 -0
- teradataml/data/TestDFFT8.csv +9 -0
- teradataml/data/TestRiver.csv +109 -0
- teradataml/data/Traindata.csv +28 -0
- teradataml/data/__init__.py +0 -0
- teradataml/data/acf.csv +17 -0
- teradataml/data/adaboost_example.json +34 -0
- teradataml/data/adaboostpredict_example.json +24 -0
- teradataml/data/additional_table.csv +11 -0
- teradataml/data/admissions_test.csv +21 -0
- teradataml/data/admissions_train.csv +41 -0
- teradataml/data/admissions_train_nulls.csv +41 -0
- teradataml/data/advertising.csv +201 -0
- teradataml/data/ageandheight.csv +13 -0
- teradataml/data/ageandpressure.csv +31 -0
- teradataml/data/amazon_reviews_25.csv +26 -0
- teradataml/data/antiselect_example.json +36 -0
- teradataml/data/antiselect_input.csv +8 -0
- teradataml/data/antiselect_input_mixed_case.csv +8 -0
- teradataml/data/applicant_external.csv +7 -0
- teradataml/data/applicant_reference.csv +7 -0
- teradataml/data/apriori_example.json +22 -0
- teradataml/data/arima_example.json +9 -0
- teradataml/data/assortedtext_input.csv +8 -0
- teradataml/data/attribution_example.json +34 -0
- teradataml/data/attribution_sample_table.csv +27 -0
- teradataml/data/attribution_sample_table1.csv +6 -0
- teradataml/data/attribution_sample_table2.csv +11 -0
- teradataml/data/bank_churn.csv +10001 -0
- teradataml/data/bank_marketing.csv +11163 -0
- teradataml/data/bank_web_clicks1.csv +43 -0
- teradataml/data/bank_web_clicks2.csv +91 -0
- teradataml/data/bank_web_url.csv +85 -0
- teradataml/data/barrier.csv +2 -0
- teradataml/data/barrier_new.csv +3 -0
- teradataml/data/betweenness_example.json +14 -0
- teradataml/data/bike_sharing.csv +732 -0
- teradataml/data/bin_breaks.csv +8 -0
- teradataml/data/bin_fit_ip.csv +4 -0
- teradataml/data/binary_complex_left.csv +11 -0
- teradataml/data/binary_complex_right.csv +11 -0
- teradataml/data/binary_matrix_complex_left.csv +21 -0
- teradataml/data/binary_matrix_complex_right.csv +21 -0
- teradataml/data/binary_matrix_real_left.csv +21 -0
- teradataml/data/binary_matrix_real_right.csv +21 -0
- teradataml/data/blood2ageandweight.csv +26 -0
- teradataml/data/bmi.csv +501 -0
- teradataml/data/boston.csv +507 -0
- teradataml/data/boston2cols.csv +721 -0
- teradataml/data/breast_cancer.csv +570 -0
- teradataml/data/buoydata_mix.csv +11 -0
- teradataml/data/burst_data.csv +5 -0
- teradataml/data/burst_example.json +21 -0
- teradataml/data/byom_example.json +34 -0
- teradataml/data/bytes_table.csv +4 -0
- teradataml/data/cal_housing_ex_raw.csv +70 -0
- teradataml/data/callers.csv +7 -0
- teradataml/data/calls.csv +10 -0
- teradataml/data/cars_hist.csv +33 -0
- teradataml/data/cat_table.csv +25 -0
- teradataml/data/ccm_example.json +32 -0
- teradataml/data/ccm_input.csv +91 -0
- teradataml/data/ccm_input2.csv +13 -0
- teradataml/data/ccmexample.csv +101 -0
- teradataml/data/ccmprepare_example.json +9 -0
- teradataml/data/ccmprepare_input.csv +91 -0
- teradataml/data/cfilter_example.json +12 -0
- teradataml/data/changepointdetection_example.json +18 -0
- teradataml/data/changepointdetectionrt_example.json +8 -0
- teradataml/data/chi_sq.csv +3 -0
- teradataml/data/churn_data.csv +14 -0
- teradataml/data/churn_emission.csv +35 -0
- teradataml/data/churn_initial.csv +3 -0
- teradataml/data/churn_state_transition.csv +5 -0
- teradataml/data/citedges_2.csv +745 -0
- teradataml/data/citvertices_2.csv +1210 -0
- teradataml/data/clicks2.csv +16 -0
- teradataml/data/clickstream.csv +13 -0
- teradataml/data/clickstream1.csv +11 -0
- teradataml/data/closeness_example.json +16 -0
- teradataml/data/complaints.csv +21 -0
- teradataml/data/complaints_mini.csv +3 -0
- teradataml/data/complaints_test_tokenized.csv +353 -0
- teradataml/data/complaints_testtoken.csv +224 -0
- teradataml/data/complaints_tokens_model.csv +348 -0
- teradataml/data/complaints_tokens_test.csv +353 -0
- teradataml/data/complaints_traintoken.csv +472 -0
- teradataml/data/computers_category.csv +1001 -0
- teradataml/data/computers_test1.csv +1252 -0
- teradataml/data/computers_train1.csv +5009 -0
- teradataml/data/computers_train1_clustered.csv +5009 -0
- teradataml/data/confusionmatrix_example.json +9 -0
- teradataml/data/conversion_event_table.csv +3 -0
- teradataml/data/corr_input.csv +17 -0
- teradataml/data/correlation_example.json +11 -0
- teradataml/data/covid_confirm_sd.csv +83 -0
- teradataml/data/coxhazardratio_example.json +39 -0
- teradataml/data/coxph_example.json +15 -0
- teradataml/data/coxsurvival_example.json +28 -0
- teradataml/data/cpt.csv +41 -0
- teradataml/data/credit_ex_merged.csv +45 -0
- teradataml/data/creditcard_data.csv +1001 -0
- teradataml/data/customer_loyalty.csv +301 -0
- teradataml/data/customer_loyalty_newseq.csv +31 -0
- teradataml/data/customer_segmentation_test.csv +2628 -0
- teradataml/data/customer_segmentation_train.csv +8069 -0
- teradataml/data/dataframe_example.json +173 -0
- teradataml/data/decisionforest_example.json +37 -0
- teradataml/data/decisionforestpredict_example.json +38 -0
- teradataml/data/decisiontree_example.json +21 -0
- teradataml/data/decisiontreepredict_example.json +45 -0
- teradataml/data/dfft2_size4_real.csv +17 -0
- teradataml/data/dfft2_test_matrix16.csv +17 -0
- teradataml/data/dfft2conv_real_4_4.csv +65 -0
- teradataml/data/diabetes.csv +443 -0
- teradataml/data/diabetes_test.csv +89 -0
- teradataml/data/dict_table.csv +5 -0
- teradataml/data/docperterm_table.csv +4 -0
- teradataml/data/docs/__init__.py +1 -0
- teradataml/data/docs/byom/__init__.py +0 -0
- teradataml/data/docs/byom/docs/DataRobotPredict.py +180 -0
- teradataml/data/docs/byom/docs/DataikuPredict.py +217 -0
- teradataml/data/docs/byom/docs/H2OPredict.py +325 -0
- teradataml/data/docs/byom/docs/ONNXEmbeddings.py +242 -0
- teradataml/data/docs/byom/docs/ONNXPredict.py +283 -0
- teradataml/data/docs/byom/docs/ONNXSeq2Seq.py +255 -0
- teradataml/data/docs/byom/docs/PMMLPredict.py +278 -0
- teradataml/data/docs/byom/docs/__init__.py +0 -0
- teradataml/data/docs/sqle/__init__.py +0 -0
- teradataml/data/docs/sqle/docs_17_10/Antiselect.py +83 -0
- teradataml/data/docs/sqle/docs_17_10/Attribution.py +200 -0
- teradataml/data/docs/sqle/docs_17_10/BincodeFit.py +172 -0
- teradataml/data/docs/sqle/docs_17_10/BincodeTransform.py +131 -0
- teradataml/data/docs/sqle/docs_17_10/CategoricalSummary.py +86 -0
- teradataml/data/docs/sqle/docs_17_10/ChiSq.py +90 -0
- teradataml/data/docs/sqle/docs_17_10/ColumnSummary.py +86 -0
- teradataml/data/docs/sqle/docs_17_10/ConvertTo.py +96 -0
- teradataml/data/docs/sqle/docs_17_10/DecisionForestPredict.py +139 -0
- teradataml/data/docs/sqle/docs_17_10/DecisionTreePredict.py +152 -0
- teradataml/data/docs/sqle/docs_17_10/FTest.py +161 -0
- teradataml/data/docs/sqle/docs_17_10/FillRowId.py +83 -0
- teradataml/data/docs/sqle/docs_17_10/Fit.py +88 -0
- teradataml/data/docs/sqle/docs_17_10/GLMPredict.py +144 -0
- teradataml/data/docs/sqle/docs_17_10/GetRowsWithMissingValues.py +85 -0
- teradataml/data/docs/sqle/docs_17_10/GetRowsWithoutMissingValues.py +82 -0
- teradataml/data/docs/sqle/docs_17_10/Histogram.py +165 -0
- teradataml/data/docs/sqle/docs_17_10/MovingAverage.py +134 -0
- teradataml/data/docs/sqle/docs_17_10/NGramSplitter.py +209 -0
- teradataml/data/docs/sqle/docs_17_10/NPath.py +266 -0
- teradataml/data/docs/sqle/docs_17_10/NaiveBayesPredict.py +116 -0
- teradataml/data/docs/sqle/docs_17_10/NaiveBayesTextClassifierPredict.py +176 -0
- teradataml/data/docs/sqle/docs_17_10/NumApply.py +147 -0
- teradataml/data/docs/sqle/docs_17_10/OneHotEncodingFit.py +135 -0
- teradataml/data/docs/sqle/docs_17_10/OneHotEncodingTransform.py +109 -0
- teradataml/data/docs/sqle/docs_17_10/OutlierFilterFit.py +166 -0
- teradataml/data/docs/sqle/docs_17_10/OutlierFilterTransform.py +105 -0
- teradataml/data/docs/sqle/docs_17_10/Pack.py +128 -0
- teradataml/data/docs/sqle/docs_17_10/PolynomialFeaturesFit.py +112 -0
- teradataml/data/docs/sqle/docs_17_10/PolynomialFeaturesTransform.py +102 -0
- teradataml/data/docs/sqle/docs_17_10/QQNorm.py +105 -0
- teradataml/data/docs/sqle/docs_17_10/RoundColumns.py +110 -0
- teradataml/data/docs/sqle/docs_17_10/RowNormalizeFit.py +118 -0
- teradataml/data/docs/sqle/docs_17_10/RowNormalizeTransform.py +99 -0
- teradataml/data/docs/sqle/docs_17_10/SVMSparsePredict.py +153 -0
- teradataml/data/docs/sqle/docs_17_10/ScaleFit.py +197 -0
- teradataml/data/docs/sqle/docs_17_10/ScaleTransform.py +99 -0
- teradataml/data/docs/sqle/docs_17_10/Sessionize.py +114 -0
- teradataml/data/docs/sqle/docs_17_10/SimpleImputeFit.py +116 -0
- teradataml/data/docs/sqle/docs_17_10/SimpleImputeTransform.py +98 -0
- teradataml/data/docs/sqle/docs_17_10/StrApply.py +187 -0
- teradataml/data/docs/sqle/docs_17_10/StringSimilarity.py +146 -0
- teradataml/data/docs/sqle/docs_17_10/Transform.py +105 -0
- teradataml/data/docs/sqle/docs_17_10/UnivariateStatistics.py +142 -0
- teradataml/data/docs/sqle/docs_17_10/Unpack.py +214 -0
- teradataml/data/docs/sqle/docs_17_10/WhichMax.py +83 -0
- teradataml/data/docs/sqle/docs_17_10/WhichMin.py +83 -0
- teradataml/data/docs/sqle/docs_17_10/ZTest.py +155 -0
- teradataml/data/docs/sqle/docs_17_10/__init__.py +0 -0
- teradataml/data/docs/sqle/docs_17_20/ANOVA.py +186 -0
- teradataml/data/docs/sqle/docs_17_20/Antiselect.py +83 -0
- teradataml/data/docs/sqle/docs_17_20/Apriori.py +138 -0
- teradataml/data/docs/sqle/docs_17_20/Attribution.py +201 -0
- teradataml/data/docs/sqle/docs_17_20/BincodeFit.py +172 -0
- teradataml/data/docs/sqle/docs_17_20/BincodeTransform.py +139 -0
- teradataml/data/docs/sqle/docs_17_20/CFilter.py +132 -0
- teradataml/data/docs/sqle/docs_17_20/CategoricalSummary.py +86 -0
- teradataml/data/docs/sqle/docs_17_20/ChiSq.py +90 -0
- teradataml/data/docs/sqle/docs_17_20/ClassificationEvaluator.py +166 -0
- teradataml/data/docs/sqle/docs_17_20/ColumnSummary.py +86 -0
- teradataml/data/docs/sqle/docs_17_20/ColumnTransformer.py +246 -0
- teradataml/data/docs/sqle/docs_17_20/ConvertTo.py +113 -0
- teradataml/data/docs/sqle/docs_17_20/DecisionForest.py +280 -0
- teradataml/data/docs/sqle/docs_17_20/DecisionForestPredict.py +144 -0
- teradataml/data/docs/sqle/docs_17_20/DecisionTreePredict.py +136 -0
- teradataml/data/docs/sqle/docs_17_20/FTest.py +240 -0
- teradataml/data/docs/sqle/docs_17_20/FillRowId.py +83 -0
- teradataml/data/docs/sqle/docs_17_20/Fit.py +88 -0
- teradataml/data/docs/sqle/docs_17_20/GLM.py +541 -0
- teradataml/data/docs/sqle/docs_17_20/GLMPerSegment.py +415 -0
- teradataml/data/docs/sqle/docs_17_20/GLMPredict.py +144 -0
- teradataml/data/docs/sqle/docs_17_20/GLMPredictPerSegment.py +233 -0
- teradataml/data/docs/sqle/docs_17_20/GetFutileColumns.py +125 -0
- teradataml/data/docs/sqle/docs_17_20/GetRowsWithMissingValues.py +109 -0
- teradataml/data/docs/sqle/docs_17_20/GetRowsWithoutMissingValues.py +106 -0
- teradataml/data/docs/sqle/docs_17_20/Histogram.py +224 -0
- teradataml/data/docs/sqle/docs_17_20/KMeans.py +251 -0
- teradataml/data/docs/sqle/docs_17_20/KMeansPredict.py +144 -0
- teradataml/data/docs/sqle/docs_17_20/KNN.py +215 -0
- teradataml/data/docs/sqle/docs_17_20/MovingAverage.py +134 -0
- teradataml/data/docs/sqle/docs_17_20/NERExtractor.py +121 -0
- teradataml/data/docs/sqle/docs_17_20/NGramSplitter.py +209 -0
- teradataml/data/docs/sqle/docs_17_20/NPath.py +266 -0
- teradataml/data/docs/sqle/docs_17_20/NaiveBayes.py +162 -0
- teradataml/data/docs/sqle/docs_17_20/NaiveBayesPredict.py +116 -0
- teradataml/data/docs/sqle/docs_17_20/NaiveBayesTextClassifierPredict.py +177 -0
- teradataml/data/docs/sqle/docs_17_20/NaiveBayesTextClassifierTrainer.py +127 -0
- teradataml/data/docs/sqle/docs_17_20/NonLinearCombineFit.py +119 -0
- teradataml/data/docs/sqle/docs_17_20/NonLinearCombineTransform.py +112 -0
- teradataml/data/docs/sqle/docs_17_20/NumApply.py +147 -0
- teradataml/data/docs/sqle/docs_17_20/OneClassSVM.py +307 -0
- teradataml/data/docs/sqle/docs_17_20/OneClassSVMPredict.py +185 -0
- teradataml/data/docs/sqle/docs_17_20/OneHotEncodingFit.py +231 -0
- teradataml/data/docs/sqle/docs_17_20/OneHotEncodingTransform.py +121 -0
- teradataml/data/docs/sqle/docs_17_20/OrdinalEncodingFit.py +220 -0
- teradataml/data/docs/sqle/docs_17_20/OrdinalEncodingTransform.py +127 -0
- teradataml/data/docs/sqle/docs_17_20/OutlierFilterFit.py +191 -0
- teradataml/data/docs/sqle/docs_17_20/OutlierFilterTransform.py +117 -0
- teradataml/data/docs/sqle/docs_17_20/Pack.py +128 -0
- teradataml/data/docs/sqle/docs_17_20/Pivoting.py +279 -0
- teradataml/data/docs/sqle/docs_17_20/PolynomialFeaturesFit.py +112 -0
- teradataml/data/docs/sqle/docs_17_20/PolynomialFeaturesTransform.py +112 -0
- teradataml/data/docs/sqle/docs_17_20/QQNorm.py +105 -0
- teradataml/data/docs/sqle/docs_17_20/ROC.py +164 -0
- teradataml/data/docs/sqle/docs_17_20/RandomProjectionFit.py +155 -0
- teradataml/data/docs/sqle/docs_17_20/RandomProjectionMinComponents.py +106 -0
- teradataml/data/docs/sqle/docs_17_20/RandomProjectionTransform.py +120 -0
- teradataml/data/docs/sqle/docs_17_20/RegressionEvaluator.py +211 -0
- teradataml/data/docs/sqle/docs_17_20/RoundColumns.py +109 -0
- teradataml/data/docs/sqle/docs_17_20/RowNormalizeFit.py +118 -0
- teradataml/data/docs/sqle/docs_17_20/RowNormalizeTransform.py +111 -0
- teradataml/data/docs/sqle/docs_17_20/SMOTE.py +212 -0
- teradataml/data/docs/sqle/docs_17_20/SVM.py +414 -0
- teradataml/data/docs/sqle/docs_17_20/SVMPredict.py +213 -0
- teradataml/data/docs/sqle/docs_17_20/SVMSparsePredict.py +153 -0
- teradataml/data/docs/sqle/docs_17_20/ScaleFit.py +315 -0
- teradataml/data/docs/sqle/docs_17_20/ScaleTransform.py +202 -0
- teradataml/data/docs/sqle/docs_17_20/SentimentExtractor.py +206 -0
- teradataml/data/docs/sqle/docs_17_20/Sessionize.py +114 -0
- teradataml/data/docs/sqle/docs_17_20/Shap.py +225 -0
- teradataml/data/docs/sqle/docs_17_20/Silhouette.py +153 -0
- teradataml/data/docs/sqle/docs_17_20/SimpleImputeFit.py +116 -0
- teradataml/data/docs/sqle/docs_17_20/SimpleImputeTransform.py +109 -0
- teradataml/data/docs/sqle/docs_17_20/StrApply.py +187 -0
- teradataml/data/docs/sqle/docs_17_20/StringSimilarity.py +146 -0
- teradataml/data/docs/sqle/docs_17_20/TDDecisionForestPredict.py +207 -0
- teradataml/data/docs/sqle/docs_17_20/TDGLMPredict.py +333 -0
- teradataml/data/docs/sqle/docs_17_20/TDNaiveBayesPredict.py +189 -0
- teradataml/data/docs/sqle/docs_17_20/TFIDF.py +142 -0
- teradataml/data/docs/sqle/docs_17_20/TargetEncodingFit.py +267 -0
- teradataml/data/docs/sqle/docs_17_20/TargetEncodingTransform.py +141 -0
- teradataml/data/docs/sqle/docs_17_20/TextMorph.py +119 -0
- teradataml/data/docs/sqle/docs_17_20/TextParser.py +224 -0
- teradataml/data/docs/sqle/docs_17_20/TrainTestSplit.py +160 -0
- teradataml/data/docs/sqle/docs_17_20/Transform.py +123 -0
- teradataml/data/docs/sqle/docs_17_20/UnivariateStatistics.py +142 -0
- teradataml/data/docs/sqle/docs_17_20/Unpack.py +214 -0
- teradataml/data/docs/sqle/docs_17_20/Unpivoting.py +216 -0
- teradataml/data/docs/sqle/docs_17_20/VectorDistance.py +169 -0
- teradataml/data/docs/sqle/docs_17_20/WhichMax.py +83 -0
- teradataml/data/docs/sqle/docs_17_20/WhichMin.py +83 -0
- teradataml/data/docs/sqle/docs_17_20/WordEmbeddings.py +237 -0
- teradataml/data/docs/sqle/docs_17_20/XGBoost.py +362 -0
- teradataml/data/docs/sqle/docs_17_20/XGBoostPredict.py +281 -0
- teradataml/data/docs/sqle/docs_17_20/ZTest.py +220 -0
- teradataml/data/docs/sqle/docs_17_20/__init__.py +0 -0
- teradataml/data/docs/tableoperator/__init__.py +0 -0
- teradataml/data/docs/tableoperator/docs_17_00/ReadNOS.py +430 -0
- teradataml/data/docs/tableoperator/docs_17_00/__init__.py +0 -0
- teradataml/data/docs/tableoperator/docs_17_05/ReadNOS.py +430 -0
- teradataml/data/docs/tableoperator/docs_17_05/WriteNOS.py +348 -0
- teradataml/data/docs/tableoperator/docs_17_05/__init__.py +0 -0
- teradataml/data/docs/tableoperator/docs_17_10/ReadNOS.py +429 -0
- teradataml/data/docs/tableoperator/docs_17_10/WriteNOS.py +348 -0
- teradataml/data/docs/tableoperator/docs_17_10/__init__.py +0 -0
- teradataml/data/docs/tableoperator/docs_17_20/Image2Matrix.py +118 -0
- teradataml/data/docs/tableoperator/docs_17_20/ReadNOS.py +440 -0
- teradataml/data/docs/tableoperator/docs_17_20/WriteNOS.py +387 -0
- teradataml/data/docs/tableoperator/docs_17_20/__init__.py +0 -0
- teradataml/data/docs/uaf/__init__.py +0 -0
- teradataml/data/docs/uaf/docs_17_20/ACF.py +186 -0
- teradataml/data/docs/uaf/docs_17_20/ArimaEstimate.py +370 -0
- teradataml/data/docs/uaf/docs_17_20/ArimaForecast.py +172 -0
- teradataml/data/docs/uaf/docs_17_20/ArimaValidate.py +161 -0
- teradataml/data/docs/uaf/docs_17_20/ArimaXEstimate.py +293 -0
- teradataml/data/docs/uaf/docs_17_20/AutoArima.py +354 -0
- teradataml/data/docs/uaf/docs_17_20/BinaryMatrixOp.py +248 -0
- teradataml/data/docs/uaf/docs_17_20/BinarySeriesOp.py +252 -0
- teradataml/data/docs/uaf/docs_17_20/BreuschGodfrey.py +178 -0
- teradataml/data/docs/uaf/docs_17_20/BreuschPaganGodfrey.py +175 -0
- teradataml/data/docs/uaf/docs_17_20/Convolve.py +230 -0
- teradataml/data/docs/uaf/docs_17_20/Convolve2.py +218 -0
- teradataml/data/docs/uaf/docs_17_20/CopyArt.py +145 -0
- teradataml/data/docs/uaf/docs_17_20/CumulPeriodogram.py +185 -0
- teradataml/data/docs/uaf/docs_17_20/DFFT.py +204 -0
- teradataml/data/docs/uaf/docs_17_20/DFFT2.py +216 -0
- teradataml/data/docs/uaf/docs_17_20/DFFT2Conv.py +216 -0
- teradataml/data/docs/uaf/docs_17_20/DFFTConv.py +192 -0
- teradataml/data/docs/uaf/docs_17_20/DIFF.py +175 -0
- teradataml/data/docs/uaf/docs_17_20/DTW.py +180 -0
- teradataml/data/docs/uaf/docs_17_20/DWT.py +235 -0
- teradataml/data/docs/uaf/docs_17_20/DWT2D.py +217 -0
- teradataml/data/docs/uaf/docs_17_20/DickeyFuller.py +142 -0
- teradataml/data/docs/uaf/docs_17_20/DurbinWatson.py +184 -0
- teradataml/data/docs/uaf/docs_17_20/ExtractResults.py +185 -0
- teradataml/data/docs/uaf/docs_17_20/FilterFactory1d.py +160 -0
- teradataml/data/docs/uaf/docs_17_20/FitMetrics.py +172 -0
- teradataml/data/docs/uaf/docs_17_20/GenseriesFormula.py +206 -0
- teradataml/data/docs/uaf/docs_17_20/GenseriesSinusoids.py +143 -0
- teradataml/data/docs/uaf/docs_17_20/GoldfeldQuandt.py +198 -0
- teradataml/data/docs/uaf/docs_17_20/HoltWintersForecaster.py +260 -0
- teradataml/data/docs/uaf/docs_17_20/IDFFT.py +165 -0
- teradataml/data/docs/uaf/docs_17_20/IDFFT2.py +191 -0
- teradataml/data/docs/uaf/docs_17_20/IDWT.py +236 -0
- teradataml/data/docs/uaf/docs_17_20/IDWT2D.py +226 -0
- teradataml/data/docs/uaf/docs_17_20/IQR.py +134 -0
- teradataml/data/docs/uaf/docs_17_20/InputValidator.py +121 -0
- teradataml/data/docs/uaf/docs_17_20/LineSpec.py +156 -0
- teradataml/data/docs/uaf/docs_17_20/LinearRegr.py +215 -0
- teradataml/data/docs/uaf/docs_17_20/MAMean.py +174 -0
- teradataml/data/docs/uaf/docs_17_20/MInfo.py +134 -0
- teradataml/data/docs/uaf/docs_17_20/Matrix2Image.py +297 -0
- teradataml/data/docs/uaf/docs_17_20/MatrixMultiply.py +145 -0
- teradataml/data/docs/uaf/docs_17_20/MultivarRegr.py +191 -0
- teradataml/data/docs/uaf/docs_17_20/PACF.py +157 -0
- teradataml/data/docs/uaf/docs_17_20/Portman.py +217 -0
- teradataml/data/docs/uaf/docs_17_20/PowerSpec.py +203 -0
- teradataml/data/docs/uaf/docs_17_20/PowerTransform.py +155 -0
- teradataml/data/docs/uaf/docs_17_20/Resample.py +237 -0
- teradataml/data/docs/uaf/docs_17_20/SAX.py +246 -0
- teradataml/data/docs/uaf/docs_17_20/SInfo.py +123 -0
- teradataml/data/docs/uaf/docs_17_20/SeasonalNormalize.py +173 -0
- teradataml/data/docs/uaf/docs_17_20/SelectionCriteria.py +174 -0
- teradataml/data/docs/uaf/docs_17_20/SignifPeriodicities.py +171 -0
- teradataml/data/docs/uaf/docs_17_20/SignifResidmean.py +164 -0
- teradataml/data/docs/uaf/docs_17_20/SimpleExp.py +180 -0
- teradataml/data/docs/uaf/docs_17_20/Smoothma.py +208 -0
- teradataml/data/docs/uaf/docs_17_20/TrackingOp.py +151 -0
- teradataml/data/docs/uaf/docs_17_20/UNDIFF.py +171 -0
- teradataml/data/docs/uaf/docs_17_20/Unnormalize.py +202 -0
- teradataml/data/docs/uaf/docs_17_20/WhitesGeneral.py +171 -0
- teradataml/data/docs/uaf/docs_17_20/WindowDFFT.py +368 -0
- teradataml/data/docs/uaf/docs_17_20/__init__.py +0 -0
- teradataml/data/dtw_example.json +18 -0
- teradataml/data/dtw_t1.csv +11 -0
- teradataml/data/dtw_t2.csv +4 -0
- teradataml/data/dwt2d_dataTable.csv +65 -0
- teradataml/data/dwt2d_example.json +16 -0
- teradataml/data/dwt_dataTable.csv +8 -0
- teradataml/data/dwt_example.json +15 -0
- teradataml/data/dwt_filterTable.csv +3 -0
- teradataml/data/dwt_filter_dim.csv +5 -0
- teradataml/data/emission.csv +9 -0
- teradataml/data/emp_table_by_dept.csv +19 -0
- teradataml/data/employee_info.csv +4 -0
- teradataml/data/employee_table.csv +6 -0
- teradataml/data/excluding_event_table.csv +2 -0
- teradataml/data/finance_data.csv +6 -0
- teradataml/data/finance_data2.csv +61 -0
- teradataml/data/finance_data3.csv +93 -0
- teradataml/data/finance_data4.csv +13 -0
- teradataml/data/fish.csv +160 -0
- teradataml/data/fm_blood2ageandweight.csv +26 -0
- teradataml/data/fmeasure_example.json +12 -0
- teradataml/data/followers_leaders.csv +10 -0
- teradataml/data/fpgrowth_example.json +12 -0
- teradataml/data/frequentpaths_example.json +29 -0
- teradataml/data/friends.csv +9 -0
- teradataml/data/fs_input.csv +33 -0
- teradataml/data/fs_input1.csv +33 -0
- teradataml/data/genData.csv +513 -0
- teradataml/data/geodataframe_example.json +40 -0
- teradataml/data/glass_types.csv +215 -0
- teradataml/data/glm_admissions_model.csv +12 -0
- teradataml/data/glm_example.json +56 -0
- teradataml/data/glml1l2_example.json +28 -0
- teradataml/data/glml1l2predict_example.json +54 -0
- teradataml/data/glmpredict_example.json +54 -0
- teradataml/data/gq_t1.csv +21 -0
- teradataml/data/grocery_transaction.csv +19 -0
- teradataml/data/hconvolve_complex_right.csv +5 -0
- teradataml/data/hconvolve_complex_rightmulti.csv +5 -0
- teradataml/data/histogram_example.json +12 -0
- teradataml/data/hmmdecoder_example.json +79 -0
- teradataml/data/hmmevaluator_example.json +25 -0
- teradataml/data/hmmsupervised_example.json +10 -0
- teradataml/data/hmmunsupervised_example.json +8 -0
- teradataml/data/hnsw_alter_data.csv +5 -0
- teradataml/data/hnsw_data.csv +10 -0
- teradataml/data/house_values.csv +12 -0
- teradataml/data/house_values2.csv +13 -0
- teradataml/data/housing_cat.csv +7 -0
- teradataml/data/housing_data.csv +9 -0
- teradataml/data/housing_test.csv +47 -0
- teradataml/data/housing_test_binary.csv +47 -0
- teradataml/data/housing_train.csv +493 -0
- teradataml/data/housing_train_attribute.csv +5 -0
- teradataml/data/housing_train_binary.csv +437 -0
- teradataml/data/housing_train_parameter.csv +2 -0
- teradataml/data/housing_train_response.csv +493 -0
- teradataml/data/housing_train_segment.csv +201 -0
- teradataml/data/ibm_stock.csv +370 -0
- teradataml/data/ibm_stock1.csv +370 -0
- teradataml/data/identitymatch_example.json +22 -0
- teradataml/data/idf_table.csv +4 -0
- teradataml/data/idwt2d_dataTable.csv +5 -0
- teradataml/data/idwt_dataTable.csv +8 -0
- teradataml/data/idwt_filterTable.csv +3 -0
- teradataml/data/impressions.csv +101 -0
- teradataml/data/inflation.csv +21 -0
- teradataml/data/initial.csv +3 -0
- teradataml/data/insect2Cols.csv +61 -0
- teradataml/data/insect_sprays.csv +13 -0
- teradataml/data/insurance.csv +1339 -0
- teradataml/data/interpolator_example.json +13 -0
- teradataml/data/interval_data.csv +5 -0
- teradataml/data/iris_altinput.csv +481 -0
- teradataml/data/iris_attribute_output.csv +8 -0
- teradataml/data/iris_attribute_test.csv +121 -0
- teradataml/data/iris_attribute_train.csv +481 -0
- teradataml/data/iris_category_expect_predict.csv +31 -0
- teradataml/data/iris_data.csv +151 -0
- teradataml/data/iris_input.csv +151 -0
- teradataml/data/iris_response_train.csv +121 -0
- teradataml/data/iris_test.csv +31 -0
- teradataml/data/iris_train.csv +121 -0
- teradataml/data/join_table1.csv +4 -0
- teradataml/data/join_table2.csv +4 -0
- teradataml/data/jsons/anly_function_name.json +7 -0
- teradataml/data/jsons/byom/ONNXSeq2Seq.json +287 -0
- teradataml/data/jsons/byom/dataikupredict.json +148 -0
- teradataml/data/jsons/byom/datarobotpredict.json +147 -0
- teradataml/data/jsons/byom/h2opredict.json +195 -0
- teradataml/data/jsons/byom/onnxembeddings.json +267 -0
- teradataml/data/jsons/byom/onnxpredict.json +187 -0
- teradataml/data/jsons/byom/pmmlpredict.json +147 -0
- teradataml/data/jsons/paired_functions.json +450 -0
- teradataml/data/jsons/sqle/16.20/Antiselect.json +56 -0
- teradataml/data/jsons/sqle/16.20/Attribution.json +249 -0
- teradataml/data/jsons/sqle/16.20/DecisionForestPredict.json +156 -0
- teradataml/data/jsons/sqle/16.20/DecisionTreePredict.json +170 -0
- teradataml/data/jsons/sqle/16.20/GLMPredict.json +122 -0
- teradataml/data/jsons/sqle/16.20/MovingAverage.json +367 -0
- teradataml/data/jsons/sqle/16.20/NGramSplitter.json +239 -0
- teradataml/data/jsons/sqle/16.20/NaiveBayesPredict.json +136 -0
- teradataml/data/jsons/sqle/16.20/NaiveBayesTextClassifierPredict.json +235 -0
- teradataml/data/jsons/sqle/16.20/Pack.json +98 -0
- teradataml/data/jsons/sqle/16.20/SVMSparsePredict.json +162 -0
- teradataml/data/jsons/sqle/16.20/Sessionize.json +105 -0
- teradataml/data/jsons/sqle/16.20/StringSimilarity.json +86 -0
- teradataml/data/jsons/sqle/16.20/Unpack.json +166 -0
- teradataml/data/jsons/sqle/16.20/nPath.json +269 -0
- teradataml/data/jsons/sqle/17.00/Antiselect.json +56 -0
- teradataml/data/jsons/sqle/17.00/Attribution.json +249 -0
- teradataml/data/jsons/sqle/17.00/DecisionForestPredict.json +156 -0
- teradataml/data/jsons/sqle/17.00/DecisionTreePredict.json +170 -0
- teradataml/data/jsons/sqle/17.00/GLMPredict.json +122 -0
- teradataml/data/jsons/sqle/17.00/MovingAverage.json +367 -0
- teradataml/data/jsons/sqle/17.00/NGramSplitter.json +239 -0
- teradataml/data/jsons/sqle/17.00/NaiveBayesPredict.json +136 -0
- teradataml/data/jsons/sqle/17.00/NaiveBayesTextClassifierPredict.json +235 -0
- teradataml/data/jsons/sqle/17.00/Pack.json +98 -0
- teradataml/data/jsons/sqle/17.00/SVMSparsePredict.json +162 -0
- teradataml/data/jsons/sqle/17.00/Sessionize.json +105 -0
- teradataml/data/jsons/sqle/17.00/StringSimilarity.json +86 -0
- teradataml/data/jsons/sqle/17.00/Unpack.json +166 -0
- teradataml/data/jsons/sqle/17.00/nPath.json +269 -0
- teradataml/data/jsons/sqle/17.05/Antiselect.json +56 -0
- teradataml/data/jsons/sqle/17.05/Attribution.json +249 -0
- teradataml/data/jsons/sqle/17.05/DecisionForestPredict.json +156 -0
- teradataml/data/jsons/sqle/17.05/DecisionTreePredict.json +170 -0
- teradataml/data/jsons/sqle/17.05/GLMPredict.json +122 -0
- teradataml/data/jsons/sqle/17.05/MovingAverage.json +367 -0
- teradataml/data/jsons/sqle/17.05/NGramSplitter.json +239 -0
- teradataml/data/jsons/sqle/17.05/NaiveBayesPredict.json +136 -0
- teradataml/data/jsons/sqle/17.05/NaiveBayesTextClassifierPredict.json +235 -0
- teradataml/data/jsons/sqle/17.05/Pack.json +98 -0
- teradataml/data/jsons/sqle/17.05/SVMSparsePredict.json +162 -0
- teradataml/data/jsons/sqle/17.05/Sessionize.json +105 -0
- teradataml/data/jsons/sqle/17.05/StringSimilarity.json +86 -0
- teradataml/data/jsons/sqle/17.05/Unpack.json +166 -0
- teradataml/data/jsons/sqle/17.05/nPath.json +269 -0
- teradataml/data/jsons/sqle/17.10/Antiselect.json +56 -0
- teradataml/data/jsons/sqle/17.10/Attribution.json +249 -0
- teradataml/data/jsons/sqle/17.10/DecisionForestPredict.json +185 -0
- teradataml/data/jsons/sqle/17.10/DecisionTreePredict.json +172 -0
- teradataml/data/jsons/sqle/17.10/GLMPredict.json +151 -0
- teradataml/data/jsons/sqle/17.10/MovingAverage.json +368 -0
- teradataml/data/jsons/sqle/17.10/NGramSplitter.json +239 -0
- teradataml/data/jsons/sqle/17.10/NaiveBayesPredict.json +149 -0
- teradataml/data/jsons/sqle/17.10/NaiveBayesTextClassifierPredict.json +288 -0
- teradataml/data/jsons/sqle/17.10/Pack.json +133 -0
- teradataml/data/jsons/sqle/17.10/SVMSparsePredict.json +193 -0
- teradataml/data/jsons/sqle/17.10/Sessionize.json +105 -0
- teradataml/data/jsons/sqle/17.10/StringSimilarity.json +86 -0
- teradataml/data/jsons/sqle/17.10/TD_BinCodeFit.json +239 -0
- teradataml/data/jsons/sqle/17.10/TD_BinCodeTransform.json +70 -0
- teradataml/data/jsons/sqle/17.10/TD_CategoricalSummary.json +54 -0
- teradataml/data/jsons/sqle/17.10/TD_Chisq.json +68 -0
- teradataml/data/jsons/sqle/17.10/TD_ColumnSummary.json +54 -0
- teradataml/data/jsons/sqle/17.10/TD_ConvertTo.json +69 -0
- teradataml/data/jsons/sqle/17.10/TD_FTest.json +187 -0
- teradataml/data/jsons/sqle/17.10/TD_FillRowID.json +52 -0
- teradataml/data/jsons/sqle/17.10/TD_FunctionFit.json +46 -0
- teradataml/data/jsons/sqle/17.10/TD_FunctionTransform.json +72 -0
- teradataml/data/jsons/sqle/17.10/TD_GetRowsWithMissingValues.json +53 -0
- teradataml/data/jsons/sqle/17.10/TD_GetRowsWithoutMissingValues.json +53 -0
- teradataml/data/jsons/sqle/17.10/TD_Histogram.json +133 -0
- teradataml/data/jsons/sqle/17.10/TD_NumApply.json +147 -0
- teradataml/data/jsons/sqle/17.10/TD_OneHotEncodingFit.json +183 -0
- teradataml/data/jsons/sqle/17.10/TD_OneHotEncodingTransform.json +66 -0
- teradataml/data/jsons/sqle/17.10/TD_OutlierFilterFit.json +197 -0
- teradataml/data/jsons/sqle/17.10/TD_OutlierFilterTransform.json +48 -0
- teradataml/data/jsons/sqle/17.10/TD_PolynomialFeaturesFit.json +114 -0
- teradataml/data/jsons/sqle/17.10/TD_PolynomialFeaturesTransform.json +72 -0
- teradataml/data/jsons/sqle/17.10/TD_QQNorm.json +112 -0
- teradataml/data/jsons/sqle/17.10/TD_RoundColumns.json +93 -0
- teradataml/data/jsons/sqle/17.10/TD_RowNormalizeFit.json +128 -0
- teradataml/data/jsons/sqle/17.10/TD_RowNormalizeTransform.json +71 -0
- teradataml/data/jsons/sqle/17.10/TD_ScaleFit.json +157 -0
- teradataml/data/jsons/sqle/17.10/TD_ScaleTransform.json +71 -0
- teradataml/data/jsons/sqle/17.10/TD_SimpleImputeFit.json +148 -0
- teradataml/data/jsons/sqle/17.10/TD_SimpleImputeTransform.json +48 -0
- teradataml/data/jsons/sqle/17.10/TD_StrApply.json +240 -0
- teradataml/data/jsons/sqle/17.10/TD_UnivariateStatistics.json +119 -0
- teradataml/data/jsons/sqle/17.10/TD_WhichMax.json +53 -0
- teradataml/data/jsons/sqle/17.10/TD_WhichMin.json +53 -0
- teradataml/data/jsons/sqle/17.10/TD_ZTest.json +171 -0
- teradataml/data/jsons/sqle/17.10/Unpack.json +188 -0
- teradataml/data/jsons/sqle/17.10/nPath.json +269 -0
- teradataml/data/jsons/sqle/17.20/Antiselect.json +56 -0
- teradataml/data/jsons/sqle/17.20/Attribution.json +249 -0
- teradataml/data/jsons/sqle/17.20/DecisionForestPredict.json +185 -0
- teradataml/data/jsons/sqle/17.20/DecisionTreePredict.json +172 -0
- teradataml/data/jsons/sqle/17.20/GLMPredict.json +151 -0
- teradataml/data/jsons/sqle/17.20/MovingAverage.json +367 -0
- teradataml/data/jsons/sqle/17.20/NGramSplitter.json +239 -0
- teradataml/data/jsons/sqle/17.20/NaiveBayesPredict.json +149 -0
- teradataml/data/jsons/sqle/17.20/NaiveBayesTextClassifierPredict.json +287 -0
- teradataml/data/jsons/sqle/17.20/Pack.json +133 -0
- teradataml/data/jsons/sqle/17.20/SVMSparsePredict.json +192 -0
- teradataml/data/jsons/sqle/17.20/Sessionize.json +105 -0
- teradataml/data/jsons/sqle/17.20/StringSimilarity.json +86 -0
- teradataml/data/jsons/sqle/17.20/TD_ANOVA.json +149 -0
- teradataml/data/jsons/sqle/17.20/TD_Apriori.json +181 -0
- teradataml/data/jsons/sqle/17.20/TD_BinCodeFit.json +239 -0
- teradataml/data/jsons/sqle/17.20/TD_BinCodeTransform.json +71 -0
- teradataml/data/jsons/sqle/17.20/TD_CFilter.json +118 -0
- teradataml/data/jsons/sqle/17.20/TD_CategoricalSummary.json +53 -0
- teradataml/data/jsons/sqle/17.20/TD_Chisq.json +68 -0
- teradataml/data/jsons/sqle/17.20/TD_ClassificationEvaluator.json +146 -0
- teradataml/data/jsons/sqle/17.20/TD_ColumnSummary.json +53 -0
- teradataml/data/jsons/sqle/17.20/TD_ColumnTransformer.json +218 -0
- teradataml/data/jsons/sqle/17.20/TD_ConvertTo.json +92 -0
- teradataml/data/jsons/sqle/17.20/TD_DecisionForest.json +260 -0
- teradataml/data/jsons/sqle/17.20/TD_DecisionForestPredict.json +139 -0
- teradataml/data/jsons/sqle/17.20/TD_FTest.json +269 -0
- teradataml/data/jsons/sqle/17.20/TD_FillRowID.json +52 -0
- teradataml/data/jsons/sqle/17.20/TD_FunctionFit.json +46 -0
- teradataml/data/jsons/sqle/17.20/TD_FunctionTransform.json +72 -0
- teradataml/data/jsons/sqle/17.20/TD_GLM.json +507 -0
- teradataml/data/jsons/sqle/17.20/TD_GLMPREDICT.json +168 -0
- teradataml/data/jsons/sqle/17.20/TD_GLMPerSegment.json +411 -0
- teradataml/data/jsons/sqle/17.20/TD_GLMPredictPerSegment.json +146 -0
- teradataml/data/jsons/sqle/17.20/TD_GetFutileColumns.json +93 -0
- teradataml/data/jsons/sqle/17.20/TD_GetRowsWithMissingValues.json +76 -0
- teradataml/data/jsons/sqle/17.20/TD_GetRowsWithoutMissingValues.json +76 -0
- teradataml/data/jsons/sqle/17.20/TD_Histogram.json +152 -0
- teradataml/data/jsons/sqle/17.20/TD_KMeans.json +232 -0
- teradataml/data/jsons/sqle/17.20/TD_KMeansPredict.json +87 -0
- teradataml/data/jsons/sqle/17.20/TD_KNN.json +262 -0
- teradataml/data/jsons/sqle/17.20/TD_NERExtractor.json +145 -0
- teradataml/data/jsons/sqle/17.20/TD_NaiveBayes.json +193 -0
- teradataml/data/jsons/sqle/17.20/TD_NaiveBayesPredict.json +212 -0
- teradataml/data/jsons/sqle/17.20/TD_NaiveBayesTextClassifierTrainer.json +137 -0
- teradataml/data/jsons/sqle/17.20/TD_NonLinearCombineFit.json +102 -0
- teradataml/data/jsons/sqle/17.20/TD_NonLinearCombineTransform.json +71 -0
- teradataml/data/jsons/sqle/17.20/TD_NumApply.json +147 -0
- teradataml/data/jsons/sqle/17.20/TD_OneClassSVM.json +316 -0
- teradataml/data/jsons/sqle/17.20/TD_OneClassSVMPredict.json +124 -0
- teradataml/data/jsons/sqle/17.20/TD_OneHotEncodingFit.json +271 -0
- teradataml/data/jsons/sqle/17.20/TD_OneHotEncodingTransform.json +65 -0
- teradataml/data/jsons/sqle/17.20/TD_OrdinalEncodingFit.json +229 -0
- teradataml/data/jsons/sqle/17.20/TD_OrdinalEncodingTransform.json +75 -0
- teradataml/data/jsons/sqle/17.20/TD_OutlierFilterFit.json +217 -0
- teradataml/data/jsons/sqle/17.20/TD_OutlierFilterTransform.json +48 -0
- teradataml/data/jsons/sqle/17.20/TD_Pivoting.json +280 -0
- teradataml/data/jsons/sqle/17.20/TD_PolynomialFeaturesFit.json +114 -0
- teradataml/data/jsons/sqle/17.20/TD_PolynomialFeaturesTransform.json +72 -0
- teradataml/data/jsons/sqle/17.20/TD_QQNorm.json +111 -0
- teradataml/data/jsons/sqle/17.20/TD_ROC.json +179 -0
- teradataml/data/jsons/sqle/17.20/TD_RandomProjectionFit.json +179 -0
- teradataml/data/jsons/sqle/17.20/TD_RandomProjectionMinComponents.json +74 -0
- teradataml/data/jsons/sqle/17.20/TD_RandomProjectionTransform.json +74 -0
- teradataml/data/jsons/sqle/17.20/TD_RegressionEvaluator.json +138 -0
- teradataml/data/jsons/sqle/17.20/TD_RoundColumns.json +93 -0
- teradataml/data/jsons/sqle/17.20/TD_RowNormalizeFit.json +128 -0
- teradataml/data/jsons/sqle/17.20/TD_RowNormalizeTransform.json +71 -0
- teradataml/data/jsons/sqle/17.20/TD_SMOTE.json +267 -0
- teradataml/data/jsons/sqle/17.20/TD_SVM.json +389 -0
- teradataml/data/jsons/sqle/17.20/TD_SVMPredict.json +142 -0
- teradataml/data/jsons/sqle/17.20/TD_ScaleFit.json +310 -0
- teradataml/data/jsons/sqle/17.20/TD_ScaleTransform.json +120 -0
- teradataml/data/jsons/sqle/17.20/TD_SentimentExtractor.json +194 -0
- teradataml/data/jsons/sqle/17.20/TD_Shap.json +221 -0
- teradataml/data/jsons/sqle/17.20/TD_Silhouette.json +143 -0
- teradataml/data/jsons/sqle/17.20/TD_SimpleImputeFit.json +147 -0
- teradataml/data/jsons/sqle/17.20/TD_SimpleImputeTransform.json +48 -0
- teradataml/data/jsons/sqle/17.20/TD_StrApply.json +240 -0
- teradataml/data/jsons/sqle/17.20/TD_TFIDF.json +162 -0
- teradataml/data/jsons/sqle/17.20/TD_TargetEncodingFit.json +248 -0
- teradataml/data/jsons/sqle/17.20/TD_TargetEncodingTransform.json +75 -0
- teradataml/data/jsons/sqle/17.20/TD_TextMorph.json +134 -0
- teradataml/data/jsons/sqle/17.20/TD_TextParser.json +297 -0
- teradataml/data/jsons/sqle/17.20/TD_TrainTestSplit.json +142 -0
- teradataml/data/jsons/sqle/17.20/TD_UnivariateStatistics.json +117 -0
- teradataml/data/jsons/sqle/17.20/TD_Unpivoting.json +235 -0
- teradataml/data/jsons/sqle/17.20/TD_VectorDistance.json +183 -0
- teradataml/data/jsons/sqle/17.20/TD_WhichMax.json +53 -0
- teradataml/data/jsons/sqle/17.20/TD_WhichMin.json +53 -0
- teradataml/data/jsons/sqle/17.20/TD_WordEmbeddings.json +241 -0
- teradataml/data/jsons/sqle/17.20/TD_XGBoost.json +330 -0
- teradataml/data/jsons/sqle/17.20/TD_XGBoostPredict.json +195 -0
- teradataml/data/jsons/sqle/17.20/TD_ZTest.json +247 -0
- teradataml/data/jsons/sqle/17.20/Unpack.json +188 -0
- teradataml/data/jsons/sqle/17.20/nPath.json +269 -0
- teradataml/data/jsons/sqle/20.00/AI_AnalyzeSentiment.json +370 -0
- teradataml/data/jsons/sqle/20.00/AI_AskLLM.json +460 -0
- teradataml/data/jsons/sqle/20.00/AI_DetectLanguage.json +385 -0
- teradataml/data/jsons/sqle/20.00/AI_ExtractKeyPhrases.json +369 -0
- teradataml/data/jsons/sqle/20.00/AI_MaskPII.json +369 -0
- teradataml/data/jsons/sqle/20.00/AI_RecognizeEntities.json +369 -0
- teradataml/data/jsons/sqle/20.00/AI_RecognizePIIEntities.json +369 -0
- teradataml/data/jsons/sqle/20.00/AI_TextClassifier.json +400 -0
- teradataml/data/jsons/sqle/20.00/AI_TextEmbeddings.json +401 -0
- teradataml/data/jsons/sqle/20.00/AI_TextSummarize.json +384 -0
- teradataml/data/jsons/sqle/20.00/AI_TextTranslate.json +384 -0
- teradataml/data/jsons/sqle/20.00/TD_API_AzureML.json +151 -0
- teradataml/data/jsons/sqle/20.00/TD_API_Sagemaker.json +182 -0
- teradataml/data/jsons/sqle/20.00/TD_API_VertexAI.json +183 -0
- teradataml/data/jsons/sqle/20.00/TD_HNSW.json +296 -0
- teradataml/data/jsons/sqle/20.00/TD_HNSWPredict.json +206 -0
- teradataml/data/jsons/sqle/20.00/TD_HNSWSummary.json +32 -0
- teradataml/data/jsons/sqle/20.00/TD_KMeans.json +250 -0
- teradataml/data/jsons/sqle/20.00/TD_SMOTE.json +266 -0
- teradataml/data/jsons/sqle/20.00/TD_VectorDistance.json +278 -0
- teradataml/data/jsons/storedprocedure/17.20/TD_COPYART.json +71 -0
- teradataml/data/jsons/storedprocedure/17.20/TD_FILTERFACTORY1D.json +150 -0
- teradataml/data/jsons/tableoperator/17.00/read_nos.json +198 -0
- teradataml/data/jsons/tableoperator/17.05/read_nos.json +198 -0
- teradataml/data/jsons/tableoperator/17.05/write_nos.json +195 -0
- teradataml/data/jsons/tableoperator/17.10/read_nos.json +184 -0
- teradataml/data/jsons/tableoperator/17.10/write_nos.json +195 -0
- teradataml/data/jsons/tableoperator/17.20/IMAGE2MATRIX.json +53 -0
- teradataml/data/jsons/tableoperator/17.20/read_nos.json +183 -0
- teradataml/data/jsons/tableoperator/17.20/write_nos.json +224 -0
- teradataml/data/jsons/uaf/17.20/TD_ACF.json +132 -0
- teradataml/data/jsons/uaf/17.20/TD_ARIMAESTIMATE.json +396 -0
- teradataml/data/jsons/uaf/17.20/TD_ARIMAFORECAST.json +77 -0
- teradataml/data/jsons/uaf/17.20/TD_ARIMAVALIDATE.json +153 -0
- teradataml/data/jsons/uaf/17.20/TD_ARIMAXESTIMATE.json +362 -0
- teradataml/data/jsons/uaf/17.20/TD_AUTOARIMA.json +469 -0
- teradataml/data/jsons/uaf/17.20/TD_BINARYMATRIXOP.json +107 -0
- teradataml/data/jsons/uaf/17.20/TD_BINARYSERIESOP.json +106 -0
- teradataml/data/jsons/uaf/17.20/TD_BREUSCH_GODFREY.json +89 -0
- teradataml/data/jsons/uaf/17.20/TD_BREUSCH_PAGAN_GODFREY.json +104 -0
- teradataml/data/jsons/uaf/17.20/TD_CONVOLVE.json +78 -0
- teradataml/data/jsons/uaf/17.20/TD_CONVOLVE2.json +66 -0
- teradataml/data/jsons/uaf/17.20/TD_CUMUL_PERIODOGRAM.json +87 -0
- teradataml/data/jsons/uaf/17.20/TD_DFFT.json +134 -0
- teradataml/data/jsons/uaf/17.20/TD_DFFT2.json +144 -0
- teradataml/data/jsons/uaf/17.20/TD_DFFT2CONV.json +108 -0
- teradataml/data/jsons/uaf/17.20/TD_DFFTCONV.json +108 -0
- teradataml/data/jsons/uaf/17.20/TD_DICKEY_FULLER.json +78 -0
- teradataml/data/jsons/uaf/17.20/TD_DIFF.json +92 -0
- teradataml/data/jsons/uaf/17.20/TD_DTW.json +114 -0
- teradataml/data/jsons/uaf/17.20/TD_DURBIN_WATSON.json +101 -0
- teradataml/data/jsons/uaf/17.20/TD_DWT.json +173 -0
- teradataml/data/jsons/uaf/17.20/TD_DWT2D.json +160 -0
- teradataml/data/jsons/uaf/17.20/TD_EXTRACT_RESULTS.json +39 -0
- teradataml/data/jsons/uaf/17.20/TD_FITMETRICS.json +101 -0
- teradataml/data/jsons/uaf/17.20/TD_GENSERIES4FORMULA.json +85 -0
- teradataml/data/jsons/uaf/17.20/TD_GENSERIES4SINUSOIDS.json +71 -0
- teradataml/data/jsons/uaf/17.20/TD_GOLDFELD_QUANDT.json +139 -0
- teradataml/data/jsons/uaf/17.20/TD_HOLT_WINTERS_FORECASTER.json +313 -0
- teradataml/data/jsons/uaf/17.20/TD_IDFFT.json +58 -0
- teradataml/data/jsons/uaf/17.20/TD_IDFFT2.json +81 -0
- teradataml/data/jsons/uaf/17.20/TD_IDWT.json +162 -0
- teradataml/data/jsons/uaf/17.20/TD_IDWT2D.json +149 -0
- teradataml/data/jsons/uaf/17.20/TD_INPUTVALIDATOR.json +64 -0
- teradataml/data/jsons/uaf/17.20/TD_IQR.json +117 -0
- teradataml/data/jsons/uaf/17.20/TD_LINEAR_REGR.json +182 -0
- teradataml/data/jsons/uaf/17.20/TD_LINESPEC.json +103 -0
- teradataml/data/jsons/uaf/17.20/TD_MAMEAN.json +181 -0
- teradataml/data/jsons/uaf/17.20/TD_MATRIX2IMAGE.json +209 -0
- teradataml/data/jsons/uaf/17.20/TD_MATRIXMULTIPLY.json +68 -0
- teradataml/data/jsons/uaf/17.20/TD_MINFO.json +67 -0
- teradataml/data/jsons/uaf/17.20/TD_MULTIVAR_REGR.json +179 -0
- teradataml/data/jsons/uaf/17.20/TD_PACF.json +114 -0
- teradataml/data/jsons/uaf/17.20/TD_PORTMAN.json +119 -0
- teradataml/data/jsons/uaf/17.20/TD_POWERSPEC.json +175 -0
- teradataml/data/jsons/uaf/17.20/TD_POWERTRANSFORM.json +98 -0
- teradataml/data/jsons/uaf/17.20/TD_RESAMPLE.json +194 -0
- teradataml/data/jsons/uaf/17.20/TD_SAX.json +210 -0
- teradataml/data/jsons/uaf/17.20/TD_SEASONALNORMALIZE.json +143 -0
- teradataml/data/jsons/uaf/17.20/TD_SELECTION_CRITERIA.json +90 -0
- teradataml/data/jsons/uaf/17.20/TD_SIGNIF_PERIODICITIES.json +80 -0
- teradataml/data/jsons/uaf/17.20/TD_SIGNIF_RESIDMEAN.json +68 -0
- teradataml/data/jsons/uaf/17.20/TD_SIMPLEEXP.json +184 -0
- teradataml/data/jsons/uaf/17.20/TD_SINFO.json +58 -0
- teradataml/data/jsons/uaf/17.20/TD_SMOOTHMA.json +163 -0
- teradataml/data/jsons/uaf/17.20/TD_TRACKINGOP.json +101 -0
- teradataml/data/jsons/uaf/17.20/TD_UNDIFF.json +112 -0
- teradataml/data/jsons/uaf/17.20/TD_UNNORMALIZE.json +95 -0
- teradataml/data/jsons/uaf/17.20/TD_WHITES_GENERAL.json +78 -0
- teradataml/data/jsons/uaf/17.20/TD_WINDOWDFFT.json +410 -0
- teradataml/data/kmeans_example.json +23 -0
- teradataml/data/kmeans_table.csv +10 -0
- teradataml/data/kmeans_us_arrests_data.csv +51 -0
- teradataml/data/knn_example.json +19 -0
- teradataml/data/knnrecommender_example.json +7 -0
- teradataml/data/knnrecommenderpredict_example.json +12 -0
- teradataml/data/lar_example.json +17 -0
- teradataml/data/larpredict_example.json +30 -0
- teradataml/data/lc_new_predictors.csv +5 -0
- teradataml/data/lc_new_reference.csv +9 -0
- teradataml/data/lda_example.json +9 -0
- teradataml/data/ldainference_example.json +15 -0
- teradataml/data/ldatopicsummary_example.json +9 -0
- teradataml/data/levendist_input.csv +13 -0
- teradataml/data/levenshteindistance_example.json +10 -0
- teradataml/data/linreg_example.json +10 -0
- teradataml/data/load_example_data.py +350 -0
- teradataml/data/loan_prediction.csv +295 -0
- teradataml/data/lungcancer.csv +138 -0
- teradataml/data/mappingdata.csv +12 -0
- teradataml/data/medical_readings.csv +101 -0
- teradataml/data/milk_timeseries.csv +157 -0
- teradataml/data/min_max_titanic.csv +4 -0
- teradataml/data/minhash_example.json +6 -0
- teradataml/data/ml_ratings.csv +7547 -0
- teradataml/data/ml_ratings_10.csv +2445 -0
- teradataml/data/mobile_data.csv +13 -0
- teradataml/data/model1_table.csv +5 -0
- teradataml/data/model2_table.csv +5 -0
- teradataml/data/models/License_file.txt +1 -0
- teradataml/data/models/License_file_empty.txt +0 -0
- teradataml/data/models/dataiku_iris_data_ann_thin +0 -0
- teradataml/data/models/dr_iris_rf +0 -0
- teradataml/data/models/iris_db_dt_model_sklearn.onnx +0 -0
- teradataml/data/models/iris_db_dt_model_sklearn_floattensor.onnx +0 -0
- teradataml/data/models/iris_db_glm_model.pmml +57 -0
- teradataml/data/models/iris_db_xgb_model.pmml +4471 -0
- teradataml/data/models/iris_kmeans_model +0 -0
- teradataml/data/models/iris_mojo_glm_h2o_model +0 -0
- teradataml/data/models/iris_mojo_xgb_h2o_model +0 -0
- teradataml/data/modularity_example.json +12 -0
- teradataml/data/movavg_example.json +8 -0
- teradataml/data/mtx1.csv +7 -0
- teradataml/data/mtx2.csv +13 -0
- teradataml/data/multi_model_classification.csv +401 -0
- teradataml/data/multi_model_regression.csv +401 -0
- teradataml/data/mvdfft8.csv +9 -0
- teradataml/data/naivebayes_example.json +10 -0
- teradataml/data/naivebayespredict_example.json +19 -0
- teradataml/data/naivebayestextclassifier2_example.json +7 -0
- teradataml/data/naivebayestextclassifier_example.json +8 -0
- teradataml/data/naivebayestextclassifierpredict_example.json +32 -0
- teradataml/data/name_Find_configure.csv +10 -0
- teradataml/data/namedentityfinder_example.json +14 -0
- teradataml/data/namedentityfinderevaluator_example.json +10 -0
- teradataml/data/namedentityfindertrainer_example.json +6 -0
- teradataml/data/nb_iris_input_test.csv +31 -0
- teradataml/data/nb_iris_input_train.csv +121 -0
- teradataml/data/nbp_iris_model.csv +13 -0
- teradataml/data/ner_dict.csv +8 -0
- teradataml/data/ner_extractor_text.csv +2 -0
- teradataml/data/ner_input_eng.csv +7 -0
- teradataml/data/ner_rule.csv +5 -0
- teradataml/data/ner_sports_test2.csv +29 -0
- teradataml/data/ner_sports_train.csv +501 -0
- teradataml/data/nerevaluator_example.json +6 -0
- teradataml/data/nerextractor_example.json +18 -0
- teradataml/data/nermem_sports_test.csv +18 -0
- teradataml/data/nermem_sports_train.csv +51 -0
- teradataml/data/nertrainer_example.json +7 -0
- teradataml/data/ngrams_example.json +7 -0
- teradataml/data/notebooks/__init__.py +0 -0
- teradataml/data/notebooks/sqlalchemy/Teradata Vantage Aggregate Functions using SQLAlchemy.ipynb +1455 -0
- teradataml/data/notebooks/sqlalchemy/Teradata Vantage Arithmetic Functions Using SQLAlchemy.ipynb +1993 -0
- teradataml/data/notebooks/sqlalchemy/Teradata Vantage Bit-Byte Manipulation Functions using SQLAlchemy.ipynb +1492 -0
- teradataml/data/notebooks/sqlalchemy/Teradata Vantage Built-in functions using SQLAlchemy.ipynb +536 -0
- teradataml/data/notebooks/sqlalchemy/Teradata Vantage Regular Expressions Using SQLAlchemy.ipynb +570 -0
- teradataml/data/notebooks/sqlalchemy/Teradata Vantage String Functions Using SQLAlchemy.ipynb +2559 -0
- teradataml/data/notebooks/sqlalchemy/Teradata Vantage Window Aggregate Functions using SQLAlchemy.ipynb +2911 -0
- teradataml/data/notebooks/sqlalchemy/Using Generic SQLAlchemy ClauseElements teradataml DataFrame assign method.ipynb +698 -0
- teradataml/data/notebooks/sqlalchemy/__init__.py +0 -0
- teradataml/data/notebooks/sqlalchemy/teradataml filtering using SQLAlchemy ClauseElements.ipynb +784 -0
- teradataml/data/npath_example.json +23 -0
- teradataml/data/ntree_example.json +14 -0
- teradataml/data/numeric_strings.csv +5 -0
- teradataml/data/numerics.csv +4 -0
- teradataml/data/ocean_buoy.csv +17 -0
- teradataml/data/ocean_buoy2.csv +17 -0
- teradataml/data/ocean_buoys.csv +28 -0
- teradataml/data/ocean_buoys2.csv +10 -0
- teradataml/data/ocean_buoys_nonpti.csv +28 -0
- teradataml/data/ocean_buoys_seq.csv +29 -0
- teradataml/data/onehot_encoder_train.csv +4 -0
- teradataml/data/openml_example.json +92 -0
- teradataml/data/optional_event_table.csv +4 -0
- teradataml/data/orders1.csv +11 -0
- teradataml/data/orders1_12.csv +13 -0
- teradataml/data/orders_ex.csv +4 -0
- teradataml/data/pack_example.json +9 -0
- teradataml/data/package_tracking.csv +19 -0
- teradataml/data/package_tracking_pti.csv +19 -0
- teradataml/data/pagerank_example.json +13 -0
- teradataml/data/paragraphs_input.csv +6 -0
- teradataml/data/pathanalyzer_example.json +8 -0
- teradataml/data/pathgenerator_example.json +8 -0
- teradataml/data/patient_profile.csv +101 -0
- teradataml/data/pattern_matching_data.csv +11 -0
- teradataml/data/payment_fraud_dataset.csv +10001 -0
- teradataml/data/peppers.png +0 -0
- teradataml/data/phrases.csv +7 -0
- teradataml/data/pivot_example.json +9 -0
- teradataml/data/pivot_input.csv +22 -0
- teradataml/data/playerRating.csv +31 -0
- teradataml/data/pos_input.csv +40 -0
- teradataml/data/postagger_example.json +7 -0
- teradataml/data/posttagger_output.csv +44 -0
- teradataml/data/production_data.csv +17 -0
- teradataml/data/production_data2.csv +7 -0
- teradataml/data/randomsample_example.json +32 -0
- teradataml/data/randomwalksample_example.json +9 -0
- teradataml/data/rank_table.csv +6 -0
- teradataml/data/real_values.csv +14 -0
- teradataml/data/ref_mobile_data.csv +4 -0
- teradataml/data/ref_mobile_data_dense.csv +2 -0
- teradataml/data/ref_url.csv +17 -0
- teradataml/data/restaurant_reviews.csv +7 -0
- teradataml/data/retail_churn_table.csv +27772 -0
- teradataml/data/river_data.csv +145 -0
- teradataml/data/roc_example.json +8 -0
- teradataml/data/roc_input.csv +101 -0
- teradataml/data/rule_inputs.csv +6 -0
- teradataml/data/rule_table.csv +2 -0
- teradataml/data/sales.csv +7 -0
- teradataml/data/sales_transaction.csv +501 -0
- teradataml/data/salesdata.csv +342 -0
- teradataml/data/sample_cities.csv +3 -0
- teradataml/data/sample_shapes.csv +11 -0
- teradataml/data/sample_streets.csv +3 -0
- teradataml/data/sampling_example.json +16 -0
- teradataml/data/sax_example.json +17 -0
- teradataml/data/scale_attributes.csv +3 -0
- teradataml/data/scale_example.json +74 -0
- teradataml/data/scale_housing.csv +11 -0
- teradataml/data/scale_housing_test.csv +6 -0
- teradataml/data/scale_input_part_sparse.csv +31 -0
- teradataml/data/scale_input_partitioned.csv +16 -0
- teradataml/data/scale_input_sparse.csv +11 -0
- teradataml/data/scale_parameters.csv +3 -0
- teradataml/data/scale_stat.csv +11 -0
- teradataml/data/scalebypartition_example.json +13 -0
- teradataml/data/scalemap_example.json +13 -0
- teradataml/data/scalesummary_example.json +12 -0
- teradataml/data/score_category.csv +101 -0
- teradataml/data/score_summary.csv +4 -0
- teradataml/data/script_example.json +10 -0
- teradataml/data/scripts/deploy_script.py +84 -0
- teradataml/data/scripts/lightgbm/dataset.template +175 -0
- teradataml/data/scripts/lightgbm/lightgbm_class_functions.template +264 -0
- teradataml/data/scripts/lightgbm/lightgbm_function.template +234 -0
- teradataml/data/scripts/lightgbm/lightgbm_sklearn.template +177 -0
- teradataml/data/scripts/mapper.R +20 -0
- teradataml/data/scripts/mapper.py +16 -0
- teradataml/data/scripts/mapper_replace.py +16 -0
- teradataml/data/scripts/sklearn/__init__.py +0 -0
- teradataml/data/scripts/sklearn/sklearn_fit.py +205 -0
- teradataml/data/scripts/sklearn/sklearn_fit_predict.py +148 -0
- teradataml/data/scripts/sklearn/sklearn_function.template +144 -0
- teradataml/data/scripts/sklearn/sklearn_model_selection_split.py +166 -0
- teradataml/data/scripts/sklearn/sklearn_neighbors.py +161 -0
- teradataml/data/scripts/sklearn/sklearn_score.py +145 -0
- teradataml/data/scripts/sklearn/sklearn_transform.py +327 -0
- teradataml/data/sdk/modelops/modelops_spec.json +101737 -0
- teradataml/data/seeds.csv +10 -0
- teradataml/data/sentenceextractor_example.json +7 -0
- teradataml/data/sentiment_extract_input.csv +11 -0
- teradataml/data/sentiment_train.csv +16 -0
- teradataml/data/sentiment_word.csv +20 -0
- teradataml/data/sentiment_word_input.csv +20 -0
- teradataml/data/sentimentextractor_example.json +24 -0
- teradataml/data/sentimenttrainer_example.json +8 -0
- teradataml/data/sequence_table.csv +10 -0
- teradataml/data/seriessplitter_example.json +8 -0
- teradataml/data/sessionize_example.json +17 -0
- teradataml/data/sessionize_table.csv +116 -0
- teradataml/data/setop_test1.csv +24 -0
- teradataml/data/setop_test2.csv +22 -0
- teradataml/data/soc_nw_edges.csv +11 -0
- teradataml/data/soc_nw_vertices.csv +8 -0
- teradataml/data/souvenir_timeseries.csv +168 -0
- teradataml/data/sparse_iris_attribute.csv +5 -0
- teradataml/data/sparse_iris_test.csv +121 -0
- teradataml/data/sparse_iris_train.csv +601 -0
- teradataml/data/star1.csv +6 -0
- teradataml/data/star_pivot.csv +8 -0
- teradataml/data/state_transition.csv +5 -0
- teradataml/data/stock_data.csv +53 -0
- teradataml/data/stock_movement.csv +11 -0
- teradataml/data/stock_vol.csv +76 -0
- teradataml/data/stop_words.csv +8 -0
- teradataml/data/store_sales.csv +37 -0
- teradataml/data/stringsimilarity_example.json +8 -0
- teradataml/data/strsimilarity_input.csv +13 -0
- teradataml/data/students.csv +101 -0
- teradataml/data/svm_iris_input_test.csv +121 -0
- teradataml/data/svm_iris_input_train.csv +481 -0
- teradataml/data/svm_iris_model.csv +7 -0
- teradataml/data/svmdense_example.json +10 -0
- teradataml/data/svmdensepredict_example.json +19 -0
- teradataml/data/svmsparse_example.json +8 -0
- teradataml/data/svmsparsepredict_example.json +14 -0
- teradataml/data/svmsparsesummary_example.json +8 -0
- teradataml/data/target_mobile_data.csv +13 -0
- teradataml/data/target_mobile_data_dense.csv +5 -0
- teradataml/data/target_udt_data.csv +8 -0
- teradataml/data/tdnerextractor_example.json +14 -0
- teradataml/data/templatedata.csv +1201 -0
- teradataml/data/templates/open_source_ml.json +11 -0
- teradataml/data/teradata_icon.ico +0 -0
- teradataml/data/teradataml_example.json +1473 -0
- teradataml/data/test_classification.csv +101 -0
- teradataml/data/test_loan_prediction.csv +53 -0
- teradataml/data/test_pacf_12.csv +37 -0
- teradataml/data/test_prediction.csv +101 -0
- teradataml/data/test_regression.csv +101 -0
- teradataml/data/test_river2.csv +109 -0
- teradataml/data/text_inputs.csv +6 -0
- teradataml/data/textchunker_example.json +8 -0
- teradataml/data/textclassifier_example.json +7 -0
- teradataml/data/textclassifier_input.csv +7 -0
- teradataml/data/textclassifiertrainer_example.json +7 -0
- teradataml/data/textmorph_example.json +11 -0
- teradataml/data/textparser_example.json +15 -0
- teradataml/data/texttagger_example.json +12 -0
- teradataml/data/texttokenizer_example.json +7 -0
- teradataml/data/texttrainer_input.csv +11 -0
- teradataml/data/tf_example.json +7 -0
- teradataml/data/tfidf_example.json +14 -0
- teradataml/data/tfidf_input1.csv +201 -0
- teradataml/data/tfidf_train.csv +6 -0
- teradataml/data/time_table1.csv +535 -0
- teradataml/data/time_table2.csv +14 -0
- teradataml/data/timeseriesdata.csv +1601 -0
- teradataml/data/timeseriesdatasetsd4.csv +105 -0
- teradataml/data/timestamp_data.csv +4 -0
- teradataml/data/titanic.csv +892 -0
- teradataml/data/titanic_dataset_unpivoted.csv +19 -0
- teradataml/data/to_num_data.csv +4 -0
- teradataml/data/tochar_data.csv +5 -0
- teradataml/data/token_table.csv +696 -0
- teradataml/data/train_multiclass.csv +101 -0
- teradataml/data/train_regression.csv +101 -0
- teradataml/data/train_regression_multiple_labels.csv +101 -0
- teradataml/data/train_tracking.csv +28 -0
- teradataml/data/trans_dense.csv +16 -0
- teradataml/data/trans_sparse.csv +55 -0
- teradataml/data/transformation_table.csv +6 -0
- teradataml/data/transformation_table_new.csv +2 -0
- teradataml/data/tv_spots.csv +16 -0
- teradataml/data/twod_climate_data.csv +117 -0
- teradataml/data/uaf_example.json +529 -0
- teradataml/data/univariatestatistics_example.json +9 -0
- teradataml/data/unpack_example.json +10 -0
- teradataml/data/unpivot_example.json +25 -0
- teradataml/data/unpivot_input.csv +8 -0
- teradataml/data/url_data.csv +10 -0
- teradataml/data/us_air_pass.csv +37 -0
- teradataml/data/us_population.csv +624 -0
- teradataml/data/us_states_shapes.csv +52 -0
- teradataml/data/varmax_example.json +18 -0
- teradataml/data/vectordistance_example.json +30 -0
- teradataml/data/ville_climatedata.csv +121 -0
- teradataml/data/ville_tempdata.csv +12 -0
- teradataml/data/ville_tempdata1.csv +12 -0
- teradataml/data/ville_temperature.csv +11 -0
- teradataml/data/waveletTable.csv +1605 -0
- teradataml/data/waveletTable2.csv +1605 -0
- teradataml/data/weightedmovavg_example.json +9 -0
- teradataml/data/wft_testing.csv +5 -0
- teradataml/data/windowdfft.csv +16 -0
- teradataml/data/wine_data.csv +1600 -0
- teradataml/data/word_embed_input_table1.csv +6 -0
- teradataml/data/word_embed_input_table2.csv +5 -0
- teradataml/data/word_embed_model.csv +23 -0
- teradataml/data/words_input.csv +13 -0
- teradataml/data/xconvolve_complex_left.csv +6 -0
- teradataml/data/xconvolve_complex_leftmulti.csv +6 -0
- teradataml/data/xgboost_example.json +36 -0
- teradataml/data/xgboostpredict_example.json +32 -0
- teradataml/data/ztest_example.json +16 -0
- teradataml/dataframe/__init__.py +0 -0
- teradataml/dataframe/copy_to.py +2446 -0
- teradataml/dataframe/data_transfer.py +2840 -0
- teradataml/dataframe/dataframe.py +20908 -0
- teradataml/dataframe/dataframe_utils.py +2114 -0
- teradataml/dataframe/fastload.py +794 -0
- teradataml/dataframe/functions.py +2110 -0
- teradataml/dataframe/indexer.py +424 -0
- teradataml/dataframe/row.py +160 -0
- teradataml/dataframe/setop.py +1171 -0
- teradataml/dataframe/sql.py +10904 -0
- teradataml/dataframe/sql_function_parameters.py +440 -0
- teradataml/dataframe/sql_functions.py +652 -0
- teradataml/dataframe/sql_interfaces.py +220 -0
- teradataml/dataframe/vantage_function_types.py +675 -0
- teradataml/dataframe/window.py +694 -0
- teradataml/dbutils/__init__.py +3 -0
- teradataml/dbutils/dbutils.py +2871 -0
- teradataml/dbutils/filemgr.py +318 -0
- teradataml/gen_ai/__init__.py +2 -0
- teradataml/gen_ai/convAI.py +473 -0
- teradataml/geospatial/__init__.py +4 -0
- teradataml/geospatial/geodataframe.py +1105 -0
- teradataml/geospatial/geodataframecolumn.py +392 -0
- teradataml/geospatial/geometry_types.py +926 -0
- teradataml/hyperparameter_tuner/__init__.py +1 -0
- teradataml/hyperparameter_tuner/optimizer.py +4115 -0
- teradataml/hyperparameter_tuner/utils.py +303 -0
- teradataml/lib/__init__.py +0 -0
- teradataml/lib/aed_0_1.dll +0 -0
- teradataml/lib/libaed_0_1.dylib +0 -0
- teradataml/lib/libaed_0_1.so +0 -0
- teradataml/lib/libaed_0_1_aarch64.so +0 -0
- teradataml/lib/libaed_0_1_ppc64le.so +0 -0
- teradataml/opensource/__init__.py +1 -0
- teradataml/opensource/_base.py +1321 -0
- teradataml/opensource/_class.py +464 -0
- teradataml/opensource/_constants.py +61 -0
- teradataml/opensource/_lightgbm.py +949 -0
- teradataml/opensource/_sklearn.py +1008 -0
- teradataml/opensource/_wrapper_utils.py +267 -0
- teradataml/options/__init__.py +148 -0
- teradataml/options/configure.py +489 -0
- teradataml/options/display.py +187 -0
- teradataml/plot/__init__.py +3 -0
- teradataml/plot/axis.py +1427 -0
- teradataml/plot/constants.py +15 -0
- teradataml/plot/figure.py +431 -0
- teradataml/plot/plot.py +810 -0
- teradataml/plot/query_generator.py +83 -0
- teradataml/plot/subplot.py +216 -0
- teradataml/scriptmgmt/UserEnv.py +4273 -0
- teradataml/scriptmgmt/__init__.py +3 -0
- teradataml/scriptmgmt/lls_utils.py +2157 -0
- teradataml/sdk/README.md +79 -0
- teradataml/sdk/__init__.py +4 -0
- teradataml/sdk/_auth_modes.py +422 -0
- teradataml/sdk/_func_params.py +487 -0
- teradataml/sdk/_json_parser.py +453 -0
- teradataml/sdk/_openapi_spec_constants.py +249 -0
- teradataml/sdk/_utils.py +236 -0
- teradataml/sdk/api_client.py +900 -0
- teradataml/sdk/constants.py +62 -0
- teradataml/sdk/modelops/__init__.py +98 -0
- teradataml/sdk/modelops/_client.py +409 -0
- teradataml/sdk/modelops/_constants.py +304 -0
- teradataml/sdk/modelops/models.py +2308 -0
- teradataml/sdk/spinner.py +107 -0
- teradataml/series/__init__.py +0 -0
- teradataml/series/series.py +537 -0
- teradataml/series/series_utils.py +71 -0
- teradataml/store/__init__.py +12 -0
- teradataml/store/feature_store/__init__.py +0 -0
- teradataml/store/feature_store/constants.py +658 -0
- teradataml/store/feature_store/feature_store.py +4814 -0
- teradataml/store/feature_store/mind_map.py +639 -0
- teradataml/store/feature_store/models.py +7330 -0
- teradataml/store/feature_store/utils.py +390 -0
- teradataml/table_operators/Apply.py +979 -0
- teradataml/table_operators/Script.py +1739 -0
- teradataml/table_operators/TableOperator.py +1343 -0
- teradataml/table_operators/__init__.py +2 -0
- teradataml/table_operators/apply_query_generator.py +262 -0
- teradataml/table_operators/query_generator.py +493 -0
- teradataml/table_operators/table_operator_query_generator.py +462 -0
- teradataml/table_operators/table_operator_util.py +726 -0
- teradataml/table_operators/templates/dataframe_apply.template +184 -0
- teradataml/table_operators/templates/dataframe_map.template +176 -0
- teradataml/table_operators/templates/dataframe_register.template +73 -0
- teradataml/table_operators/templates/dataframe_udf.template +67 -0
- teradataml/table_operators/templates/script_executor.template +170 -0
- teradataml/telemetry_utils/__init__.py +0 -0
- teradataml/telemetry_utils/queryband.py +53 -0
- teradataml/utils/__init__.py +0 -0
- teradataml/utils/docstring.py +527 -0
- teradataml/utils/dtypes.py +943 -0
- teradataml/utils/internal_buffer.py +122 -0
- teradataml/utils/print_versions.py +206 -0
- teradataml/utils/utils.py +451 -0
- teradataml/utils/validators.py +3305 -0
- teradataml-20.0.0.8.dist-info/METADATA +2804 -0
- teradataml-20.0.0.8.dist-info/RECORD +1208 -0
- teradataml-20.0.0.8.dist-info/WHEEL +5 -0
- teradataml-20.0.0.8.dist-info/top_level.txt +1 -0
- teradataml-20.0.0.8.dist-info/zip-safe +1 -0
teradataml/data/notebooks/sqlalchemy/Teradata Vantage Arithmetic Functions Using SQLAlchemy.ipynb
ADDED
|
@@ -0,0 +1,1993 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cells": [
|
|
3
|
+
{
|
|
4
|
+
"cell_type": "markdown",
|
|
5
|
+
"metadata": {},
|
|
6
|
+
"source": [
|
|
7
|
+
"### Disclaimer\n",
|
|
8
|
+
"Please note, the Vantage Functions via SQLAlchemy feature is a preview/beta code release with limited functionality (the “Code”). As such, you acknowledge that the Code is experimental in nature and that the Code is provided “AS IS” and may not be functional on any machine or in any environment. TERADATA DISCLAIMS ALL WARRANTIES RELATING TO THE CODE, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES AGAINST INFRINGEMENT OF THIRD-PARTY RIGHTS, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\n",
|
|
9
|
+
"\n",
|
|
10
|
+
"TERADATA SHALL NOT BE RESPONSIBLE OR LIABLE WITH RESPECT TO ANY SUBJECT MATTER OF THE CODE UNDER ANY CONTRACT, NEGLIGENCE, STRICT LIABILITY OR OTHER THEORY \n",
|
|
11
|
+
" (A) FOR LOSS OR INACCURACY OF DATA OR COST OF PROCUREMENT OF SUBSTITUTE GOODS, SERVICES OR TECHNOLOGY, OR \n",
|
|
12
|
+
" (B) FOR ANY INDIRECT, INCIDENTAL OR CONSEQUENTIAL DAMAGES INCLUDING, BUT NOT LIMITED TO LOSS OF REVENUES AND LOSS OF PROFITS. TERADATA SHALL NOT BE RESPONSIBLE FOR ANY MATTER BEYOND ITS REASONABLE CONTROL.\n",
|
|
13
|
+
"\n",
|
|
14
|
+
"Notwithstanding anything to the contrary: \n",
|
|
15
|
+
" (a) Teradata will have no obligation of any kind with respect to any Code-related comments, suggestions, design changes or improvements that you elect to provide to Teradata in either verbal or written form (collectively, “Feedback”), and \n",
|
|
16
|
+
" (b) Teradata and its affiliates are hereby free to use any ideas, concepts, know-how or techniques, in whole or in part, contained in Feedback: \n",
|
|
17
|
+
" (i) for any purpose whatsoever, including developing, manufacturing, and/or marketing products and/or services incorporating Feedback in whole or in part, and \n",
|
|
18
|
+
" (ii) without any restrictions or limitations, including requiring the payment of any license fees, royalties, or other consideration. "
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"cell_type": "code",
|
|
23
|
+
"execution_count": 1,
|
|
24
|
+
"metadata": {},
|
|
25
|
+
"outputs": [],
|
|
26
|
+
"source": [
|
|
27
|
+
"# In this notebook we shall cover examples for following Arithmetic Functions:\n",
|
|
28
|
+
"# SQL Documentation: https://docs.teradata.com/reader/756LNiPSFdY~4JcCCcR5Cw/c2fX4dzxCcDJFKqXbyQtTA\n",
|
|
29
|
+
" # 1. abs\n",
|
|
30
|
+
" # 2. case_n\n",
|
|
31
|
+
" # 3. ceil/ceiling\n",
|
|
32
|
+
" # 4. degrees\n",
|
|
33
|
+
" # 5. radians\n",
|
|
34
|
+
" # 6. exp\n",
|
|
35
|
+
" # 7. floor\n",
|
|
36
|
+
" # 8. ln\n",
|
|
37
|
+
" # 9. log\n",
|
|
38
|
+
" # 10. mod\n",
|
|
39
|
+
" # 11. nullifzero \n",
|
|
40
|
+
" # 12. power\n",
|
|
41
|
+
" # 13. random\n",
|
|
42
|
+
" # 14. range_n\n",
|
|
43
|
+
" # 15. round\n",
|
|
44
|
+
" # 16. sign\n",
|
|
45
|
+
" # 17. sqrt\n",
|
|
46
|
+
" # 18. trunc\n",
|
|
47
|
+
" # 19. width_bucket\n",
|
|
48
|
+
" # Hyperbolic Functions:\n",
|
|
49
|
+
" # 1. cosh\n",
|
|
50
|
+
" # 2. acosh\n",
|
|
51
|
+
" # 3. sinh\n",
|
|
52
|
+
" # 4. asinh\n",
|
|
53
|
+
" # 5. tanh\n",
|
|
54
|
+
" # 6. atanh\n",
|
|
55
|
+
" # Trigonometric Functions:\n",
|
|
56
|
+
" # 1. sin\n",
|
|
57
|
+
" # 2. asin\n",
|
|
58
|
+
" # 3. cos\n",
|
|
59
|
+
" # 4. acos\n",
|
|
60
|
+
" # 5. tan\n",
|
|
61
|
+
" # 6. atan\n",
|
|
62
|
+
" # 7. atan2"
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"cell_type": "code",
|
|
67
|
+
"execution_count": 2,
|
|
68
|
+
"metadata": {},
|
|
69
|
+
"outputs": [
|
|
70
|
+
{
|
|
71
|
+
"name": "stdout",
|
|
72
|
+
"output_type": "stream",
|
|
73
|
+
"text": [
|
|
74
|
+
"Hostname: ········\n",
|
|
75
|
+
"Username: ········\n",
|
|
76
|
+
"Password: ········\n",
|
|
77
|
+
"WARNING: Skipped loading table admissions_train since it already exists in the database.\n"
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"source": [
|
|
82
|
+
"# Get the connection to the Vantage using create_context()\n",
|
|
83
|
+
"from teradataml import *\n",
|
|
84
|
+
"import getpass\n",
|
|
85
|
+
"td_context = create_context(host=getpass.getpass(\"Hostname: \"), username=getpass.getpass(\"Username: \"), password=getpass.getpass(\"Password: \"))\n",
|
|
86
|
+
"# Load the example dataset.\n",
|
|
87
|
+
"load_example_data(\"GLM\", [\"admissions_train\"])"
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"cell_type": "code",
|
|
92
|
+
"execution_count": 3,
|
|
93
|
+
"metadata": {},
|
|
94
|
+
"outputs": [
|
|
95
|
+
{
|
|
96
|
+
"data": {
|
|
97
|
+
"text/plain": [
|
|
98
|
+
" masters gpa stats programming admitted\n",
|
|
99
|
+
"id \n",
|
|
100
|
+
"5 no 3.44 Novice Novice 0\n",
|
|
101
|
+
"34 yes 3.85 Advanced Beginner 0\n",
|
|
102
|
+
"13 no 4.00 Advanced Novice 1\n",
|
|
103
|
+
"40 yes 3.95 Novice Beginner 0\n",
|
|
104
|
+
"22 yes 3.46 Novice Beginner 0\n",
|
|
105
|
+
"19 yes 1.98 Advanced Advanced 0\n",
|
|
106
|
+
"36 no 3.00 Advanced Novice 0\n",
|
|
107
|
+
"15 yes 4.00 Advanced Advanced 1\n",
|
|
108
|
+
"7 yes 2.33 Novice Novice 1\n",
|
|
109
|
+
"17 no 3.83 Advanced Advanced 1"
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
"execution_count": 3,
|
|
113
|
+
"metadata": {},
|
|
114
|
+
"output_type": "execute_result"
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"source": [
|
|
118
|
+
"# Create the DataFrame on 'admissions_train' table\n",
|
|
119
|
+
"admissions_train = DataFrame(\"admissions_train\")\n",
|
|
120
|
+
"admissions_train"
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"cell_type": "code",
|
|
125
|
+
"execution_count": 4,
|
|
126
|
+
"metadata": {},
|
|
127
|
+
"outputs": [],
|
|
128
|
+
"source": [
|
|
129
|
+
"def print_variables(df, columns):\n",
|
|
130
|
+
" print(\"Equivalent SQL: {}\".format(df.show_query()))\n",
|
|
131
|
+
" print(\"\\n\")\n",
|
|
132
|
+
" print(\" ************************* DataFrame ********************* \")\n",
|
|
133
|
+
" print(df)\n",
|
|
134
|
+
" print(\"\\n\\n\")\n",
|
|
135
|
+
" print(\" ************************* DataFrame.dtypes ********************* \")\n",
|
|
136
|
+
" print(df.dtypes)\n",
|
|
137
|
+
" print(\"\\n\\n\")\n",
|
|
138
|
+
" if isinstance(columns, str):\n",
|
|
139
|
+
" columns = [columns]\n",
|
|
140
|
+
" for col in columns:\n",
|
|
141
|
+
" coltype = df.__getattr__(col).type\n",
|
|
142
|
+
" if isinstance(coltype, sqlalchemy.sql.sqltypes.NullType):\n",
|
|
143
|
+
" coltype = \"NullType\"\n",
|
|
144
|
+
" print(\" '{}' Column Type: {}\".format(col, coltype))"
|
|
145
|
+
]
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"cell_type": "markdown",
|
|
149
|
+
"metadata": {},
|
|
150
|
+
"source": [
|
|
151
|
+
"## Using Arithmatic Functions in Teradata Vantage with the help SQLAlchemny"
|
|
152
|
+
]
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"cell_type": "code",
|
|
156
|
+
"execution_count": 5,
|
|
157
|
+
"metadata": {},
|
|
158
|
+
"outputs": [],
|
|
159
|
+
"source": [
|
|
160
|
+
"# Import func from SQLAlchemy to use the same for executing arithmetic functions\n",
|
|
161
|
+
"from sqlalchemy import func"
|
|
162
|
+
]
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"cell_type": "code",
|
|
166
|
+
"execution_count": 6,
|
|
167
|
+
"metadata": {},
|
|
168
|
+
"outputs": [],
|
|
169
|
+
"source": [
|
|
170
|
+
"# Before we move on with examples, one should read below just to understand how teradataml DataFrame and \n",
|
|
171
|
+
"# it's columns are used to create a SQLAlchemy ClauseElement/Expression.\n",
|
|
172
|
+
"\n",
|
|
173
|
+
"# Often in below examples one would see something like this: 'admissions_train.admitted.expression'\n",
|
|
174
|
+
"# Here in the above expression,\n",
|
|
175
|
+
"# 'admissions_train' is 'teradataml DataFrame'\n",
|
|
176
|
+
"# 'admitted' is 'column name' in teradataml DataFrame 'admissions_train'\n",
|
|
177
|
+
"# Thus, \n",
|
|
178
|
+
"# 'admissions_train.admitted' together forms a ColumnExpression.\n",
|
|
179
|
+
"# expression allows us to use teradata ColumnExpression to be treated as SQLAlchemy Expression.\n",
|
|
180
|
+
"# Thus,\n",
|
|
181
|
+
"# 'admissions_train.admitted.expression' gives us an expression that can be used with SQLAlchemy clauseElements."
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"cell_type": "markdown",
|
|
186
|
+
"metadata": {},
|
|
187
|
+
"source": [
|
|
188
|
+
"### ABS function - Compute the absolute value of an argument."
|
|
189
|
+
]
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"cell_type": "code",
|
|
193
|
+
"execution_count": 7,
|
|
194
|
+
"metadata": {},
|
|
195
|
+
"outputs": [],
|
|
196
|
+
"source": [
|
|
197
|
+
"# Function computes the absolute value of an argument.\n",
|
|
198
|
+
"# Syntax:\n",
|
|
199
|
+
"# ABS(column_expression)"
|
|
200
|
+
]
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"cell_type": "code",
|
|
204
|
+
"execution_count": 8,
|
|
205
|
+
"metadata": {},
|
|
206
|
+
"outputs": [
|
|
207
|
+
{
|
|
208
|
+
"data": {
|
|
209
|
+
"text/plain": [
|
|
210
|
+
"sqlalchemy.sql.functions.Function"
|
|
211
|
+
]
|
|
212
|
+
},
|
|
213
|
+
"execution_count": 8,
|
|
214
|
+
"metadata": {},
|
|
215
|
+
"output_type": "execute_result"
|
|
216
|
+
}
|
|
217
|
+
],
|
|
218
|
+
"source": [
|
|
219
|
+
"abs_func_ = func.abs(admissions_train.gpa.expression)\n",
|
|
220
|
+
"type(abs_func_)"
|
|
221
|
+
]
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"cell_type": "code",
|
|
225
|
+
"execution_count": 9,
|
|
226
|
+
"metadata": {},
|
|
227
|
+
"outputs": [
|
|
228
|
+
{
|
|
229
|
+
"name": "stdout",
|
|
230
|
+
"output_type": "stream",
|
|
231
|
+
"text": [
|
|
232
|
+
"Equivalent SQL: select id AS id, masters AS masters, gpa AS gpa, stats AS stats, programming AS programming, admitted AS admitted, abs(admitted) AS abd_addmitted_, abs(gpa) AS abs_gpa_ from \"admissions_train\"\n",
|
|
233
|
+
"\n",
|
|
234
|
+
"\n",
|
|
235
|
+
" ************************* DataFrame ********************* \n",
|
|
236
|
+
" masters gpa stats programming admitted abd_addmitted_ abs_gpa_\n",
|
|
237
|
+
"id \n",
|
|
238
|
+
"15 yes 4.00 Advanced Advanced 1 1 4.00\n",
|
|
239
|
+
"7 yes 2.33 Novice Novice 1 1 2.33\n",
|
|
240
|
+
"22 yes 3.46 Novice Beginner 0 0 3.46\n",
|
|
241
|
+
"17 no 3.83 Advanced Advanced 1 1 3.83\n",
|
|
242
|
+
"13 no 4.00 Advanced Novice 1 1 4.00\n",
|
|
243
|
+
"38 yes 2.65 Advanced Beginner 1 1 2.65\n",
|
|
244
|
+
"26 yes 3.57 Advanced Advanced 1 1 3.57\n",
|
|
245
|
+
"5 no 3.44 Novice Novice 0 0 3.44\n",
|
|
246
|
+
"34 yes 3.85 Advanced Beginner 0 0 3.85\n",
|
|
247
|
+
"40 yes 3.95 Novice Beginner 0 0 3.95\n",
|
|
248
|
+
"\n",
|
|
249
|
+
"\n",
|
|
250
|
+
"\n",
|
|
251
|
+
" ************************* DataFrame.dtypes ********************* \n",
|
|
252
|
+
"id int\n",
|
|
253
|
+
"masters str\n",
|
|
254
|
+
"gpa float\n",
|
|
255
|
+
"stats str\n",
|
|
256
|
+
"programming str\n",
|
|
257
|
+
"admitted int\n",
|
|
258
|
+
"abd_addmitted_ int\n",
|
|
259
|
+
"abs_gpa_ float\n",
|
|
260
|
+
"\n",
|
|
261
|
+
"\n",
|
|
262
|
+
"\n",
|
|
263
|
+
" 'abs_gpa_' Column Type: FLOAT\n"
|
|
264
|
+
]
|
|
265
|
+
}
|
|
266
|
+
],
|
|
267
|
+
"source": [
|
|
268
|
+
"df = admissions_train.assign(abs_gpa_=abs_func_, abd_addmitted_=func.abs(admissions_train.admitted.expression))\n",
|
|
269
|
+
"print_variables(df, \"abs_gpa_\")"
|
|
270
|
+
]
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
"cell_type": "markdown",
|
|
274
|
+
"metadata": {},
|
|
275
|
+
"source": [
|
|
276
|
+
"### CASE_N function"
|
|
277
|
+
]
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
"cell_type": "code",
|
|
281
|
+
"execution_count": 10,
|
|
282
|
+
"metadata": {},
|
|
283
|
+
"outputs": [],
|
|
284
|
+
"source": [
|
|
285
|
+
"# Function evaluates a list of conditions and returns the position of the first condition that evaluates to TRUE, \n",
|
|
286
|
+
"# provided that no prior condition in the list evaluates to UNKNOWN.\n",
|
|
287
|
+
"# Syntax:\n",
|
|
288
|
+
"# TODO"
|
|
289
|
+
]
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"cell_type": "code",
|
|
293
|
+
"execution_count": 11,
|
|
294
|
+
"metadata": {},
|
|
295
|
+
"outputs": [
|
|
296
|
+
{
|
|
297
|
+
"data": {
|
|
298
|
+
"text/plain": [
|
|
299
|
+
"sqlalchemy.sql.functions.Function"
|
|
300
|
+
]
|
|
301
|
+
},
|
|
302
|
+
"execution_count": 11,
|
|
303
|
+
"metadata": {},
|
|
304
|
+
"output_type": "execute_result"
|
|
305
|
+
}
|
|
306
|
+
],
|
|
307
|
+
"source": [
|
|
308
|
+
"### CASE_N function\n",
|
|
309
|
+
"case_n_func_ = func.case_N(admissions_train.stats.expression == 'Novice', admissions_train.stats.expression == 'Beginner')\n",
|
|
310
|
+
"type(case_n_func_)"
|
|
311
|
+
]
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"cell_type": "code",
|
|
315
|
+
"execution_count": 12,
|
|
316
|
+
"metadata": {},
|
|
317
|
+
"outputs": [
|
|
318
|
+
{
|
|
319
|
+
"name": "stdout",
|
|
320
|
+
"output_type": "stream",
|
|
321
|
+
"text": [
|
|
322
|
+
"Equivalent SQL: select id AS id, masters AS masters, gpa AS gpa, stats AS stats, programming AS programming, admitted AS admitted, case_N(stats = 'Novice', stats = 'Beginner') AS case_n_func_ from \"admissions_train\"\n",
|
|
323
|
+
"\n",
|
|
324
|
+
"\n",
|
|
325
|
+
" ************************* DataFrame ********************* \n",
|
|
326
|
+
" masters gpa stats programming admitted case_n_func_\n",
|
|
327
|
+
"id \n",
|
|
328
|
+
"5 no 3.44 Novice Novice 0 1.0\n",
|
|
329
|
+
"34 yes 3.85 Advanced Beginner 0 NaN\n",
|
|
330
|
+
"13 no 4.00 Advanced Novice 1 NaN\n",
|
|
331
|
+
"40 yes 3.95 Novice Beginner 0 1.0\n",
|
|
332
|
+
"22 yes 3.46 Novice Beginner 0 1.0\n",
|
|
333
|
+
"19 yes 1.98 Advanced Advanced 0 NaN\n",
|
|
334
|
+
"36 no 3.00 Advanced Novice 0 NaN\n",
|
|
335
|
+
"15 yes 4.00 Advanced Advanced 1 NaN\n",
|
|
336
|
+
"7 yes 2.33 Novice Novice 1 1.0\n",
|
|
337
|
+
"17 no 3.83 Advanced Advanced 1 NaN\n",
|
|
338
|
+
"\n",
|
|
339
|
+
"\n",
|
|
340
|
+
"\n",
|
|
341
|
+
" ************************* DataFrame.dtypes ********************* \n",
|
|
342
|
+
"id int\n",
|
|
343
|
+
"masters str\n",
|
|
344
|
+
"gpa float\n",
|
|
345
|
+
"stats str\n",
|
|
346
|
+
"programming str\n",
|
|
347
|
+
"admitted int\n",
|
|
348
|
+
"case_n_func_ int\n",
|
|
349
|
+
"\n",
|
|
350
|
+
"\n",
|
|
351
|
+
"\n",
|
|
352
|
+
" 'case_n_func_' Column Type: INTEGER\n"
|
|
353
|
+
]
|
|
354
|
+
}
|
|
355
|
+
],
|
|
356
|
+
"source": [
|
|
357
|
+
"df = admissions_train.assign(case_n_func_=case_n_func_)\n",
|
|
358
|
+
"print_variables(df, \"case_n_func_\")"
|
|
359
|
+
]
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"cell_type": "markdown",
|
|
363
|
+
"metadata": {},
|
|
364
|
+
"source": [
|
|
365
|
+
"### Ceiling or ceil function"
|
|
366
|
+
]
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
"cell_type": "code",
|
|
370
|
+
"execution_count": 13,
|
|
371
|
+
"metadata": {},
|
|
372
|
+
"outputs": [],
|
|
373
|
+
"source": [
|
|
374
|
+
"# Function returns the smallest integer value that is not less than the input argument.\n",
|
|
375
|
+
"# Syntax:\n",
|
|
376
|
+
"# ceiling(column_expression) OR\n",
|
|
377
|
+
"# ceil(column_expression)"
|
|
378
|
+
]
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
"cell_type": "code",
|
|
382
|
+
"execution_count": 14,
|
|
383
|
+
"metadata": {},
|
|
384
|
+
"outputs": [
|
|
385
|
+
{
|
|
386
|
+
"name": "stdout",
|
|
387
|
+
"output_type": "stream",
|
|
388
|
+
"text": [
|
|
389
|
+
"Equivalent SQL: select id AS id, masters AS masters, gpa AS gpa, stats AS stats, programming AS programming, admitted AS admitted, ceiling(gpa) AS ceil_func_ from \"admissions_train\"\n",
|
|
390
|
+
"\n",
|
|
391
|
+
"\n",
|
|
392
|
+
" ************************* DataFrame ********************* \n",
|
|
393
|
+
" masters gpa stats programming admitted ceil_func_\n",
|
|
394
|
+
"id \n",
|
|
395
|
+
"22 yes 3.46 Novice Beginner 0 4.0\n",
|
|
396
|
+
"36 no 3.00 Advanced Novice 0 3.0\n",
|
|
397
|
+
"15 yes 4.00 Advanced Advanced 1 4.0\n",
|
|
398
|
+
"38 yes 2.65 Advanced Beginner 1 3.0\n",
|
|
399
|
+
"5 no 3.44 Novice Novice 0 4.0\n",
|
|
400
|
+
"17 no 3.83 Advanced Advanced 1 4.0\n",
|
|
401
|
+
"34 yes 3.85 Advanced Beginner 0 4.0\n",
|
|
402
|
+
"13 no 4.00 Advanced Novice 1 4.0\n",
|
|
403
|
+
"26 yes 3.57 Advanced Advanced 1 4.0\n",
|
|
404
|
+
"19 yes 1.98 Advanced Advanced 0 2.0\n",
|
|
405
|
+
"\n",
|
|
406
|
+
"\n",
|
|
407
|
+
"\n",
|
|
408
|
+
" ************************* DataFrame.dtypes ********************* \n",
|
|
409
|
+
"id int\n",
|
|
410
|
+
"masters str\n",
|
|
411
|
+
"gpa float\n",
|
|
412
|
+
"stats str\n",
|
|
413
|
+
"programming str\n",
|
|
414
|
+
"admitted int\n",
|
|
415
|
+
"ceil_func_ float\n",
|
|
416
|
+
"\n",
|
|
417
|
+
"\n",
|
|
418
|
+
"\n",
|
|
419
|
+
" 'ceil_func_' Column Type: FLOAT\n"
|
|
420
|
+
]
|
|
421
|
+
}
|
|
422
|
+
],
|
|
423
|
+
"source": [
|
|
424
|
+
"# Use case for Ceiling \n",
|
|
425
|
+
"df = admissions_train.assign(ceil_func_ = func.ceiling(admissions_train.gpa.expression))\n",
|
|
426
|
+
"print_variables(df, \"ceil_func_\")"
|
|
427
|
+
]
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"cell_type": "code",
|
|
431
|
+
"execution_count": 15,
|
|
432
|
+
"metadata": {},
|
|
433
|
+
"outputs": [
|
|
434
|
+
{
|
|
435
|
+
"name": "stdout",
|
|
436
|
+
"output_type": "stream",
|
|
437
|
+
"text": [
|
|
438
|
+
"Equivalent SQL: select id AS id, masters AS masters, gpa AS gpa, stats AS stats, programming AS programming, admitted AS admitted, ceil(gpa) AS ceil_func_ from \"admissions_train\"\n",
|
|
439
|
+
"\n",
|
|
440
|
+
"\n",
|
|
441
|
+
" ************************* DataFrame ********************* \n",
|
|
442
|
+
" masters gpa stats programming admitted ceil_func_\n",
|
|
443
|
+
"id \n",
|
|
444
|
+
"5 no 3.44 Novice Novice 0 4.0\n",
|
|
445
|
+
"34 yes 3.85 Advanced Beginner 0 4.0\n",
|
|
446
|
+
"13 no 4.00 Advanced Novice 1 4.0\n",
|
|
447
|
+
"40 yes 3.95 Novice Beginner 0 4.0\n",
|
|
448
|
+
"22 yes 3.46 Novice Beginner 0 4.0\n",
|
|
449
|
+
"19 yes 1.98 Advanced Advanced 0 2.0\n",
|
|
450
|
+
"36 no 3.00 Advanced Novice 0 3.0\n",
|
|
451
|
+
"15 yes 4.00 Advanced Advanced 1 4.0\n",
|
|
452
|
+
"7 yes 2.33 Novice Novice 1 3.0\n",
|
|
453
|
+
"17 no 3.83 Advanced Advanced 1 4.0\n",
|
|
454
|
+
"\n",
|
|
455
|
+
"\n",
|
|
456
|
+
"\n",
|
|
457
|
+
" ************************* DataFrame.dtypes ********************* \n",
|
|
458
|
+
"id int\n",
|
|
459
|
+
"masters str\n",
|
|
460
|
+
"gpa float\n",
|
|
461
|
+
"stats str\n",
|
|
462
|
+
"programming str\n",
|
|
463
|
+
"admitted int\n",
|
|
464
|
+
"ceil_func_ float\n",
|
|
465
|
+
"\n",
|
|
466
|
+
"\n",
|
|
467
|
+
"\n",
|
|
468
|
+
" 'ceil_func_' Column Type: FLOAT\n"
|
|
469
|
+
]
|
|
470
|
+
}
|
|
471
|
+
],
|
|
472
|
+
"source": [
|
|
473
|
+
"# Use case for ceil\n",
|
|
474
|
+
"df = admissions_train.assign(ceil_func_ = func.ceil(admissions_train.gpa.expression))\n",
|
|
475
|
+
"print_variables(df, \"ceil_func_\")"
|
|
476
|
+
]
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
"cell_type": "markdown",
|
|
480
|
+
"metadata": {},
|
|
481
|
+
"source": [
|
|
482
|
+
"### Degrees & Radians functions"
|
|
483
|
+
]
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
"cell_type": "code",
|
|
487
|
+
"execution_count": 16,
|
|
488
|
+
"metadata": {},
|
|
489
|
+
"outputs": [],
|
|
490
|
+
"source": [
|
|
491
|
+
"# DEGREES takes a value specified in radians and converts it to degrees.\n",
|
|
492
|
+
"# Syntax:\n",
|
|
493
|
+
"# degrees(column_expression/constant)"
|
|
494
|
+
]
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
"cell_type": "code",
|
|
498
|
+
"execution_count": 17,
|
|
499
|
+
"metadata": {},
|
|
500
|
+
"outputs": [
|
|
501
|
+
{
|
|
502
|
+
"name": "stdout",
|
|
503
|
+
"output_type": "stream",
|
|
504
|
+
"text": [
|
|
505
|
+
"Equivalent SQL: select id AS id, masters AS masters, gpa AS gpa, stats AS stats, programming AS programming, admitted AS admitted, degrees(1) AS degrees_const_func_ from \"admissions_train\"\n",
|
|
506
|
+
"\n",
|
|
507
|
+
"\n",
|
|
508
|
+
" ************************* DataFrame ********************* \n",
|
|
509
|
+
" masters gpa stats programming admitted degrees_const_func_\n",
|
|
510
|
+
"id \n",
|
|
511
|
+
"15 yes 4.00 Advanced Advanced 1 57.29578\n",
|
|
512
|
+
"7 yes 2.33 Novice Novice 1 57.29578\n",
|
|
513
|
+
"22 yes 3.46 Novice Beginner 0 57.29578\n",
|
|
514
|
+
"17 no 3.83 Advanced Advanced 1 57.29578\n",
|
|
515
|
+
"13 no 4.00 Advanced Novice 1 57.29578\n",
|
|
516
|
+
"38 yes 2.65 Advanced Beginner 1 57.29578\n",
|
|
517
|
+
"26 yes 3.57 Advanced Advanced 1 57.29578\n",
|
|
518
|
+
"5 no 3.44 Novice Novice 0 57.29578\n",
|
|
519
|
+
"34 yes 3.85 Advanced Beginner 0 57.29578\n",
|
|
520
|
+
"40 yes 3.95 Novice Beginner 0 57.29578\n",
|
|
521
|
+
"\n",
|
|
522
|
+
"\n",
|
|
523
|
+
"\n",
|
|
524
|
+
" ************************* DataFrame.dtypes ********************* \n",
|
|
525
|
+
"id int\n",
|
|
526
|
+
"masters str\n",
|
|
527
|
+
"gpa float\n",
|
|
528
|
+
"stats str\n",
|
|
529
|
+
"programming str\n",
|
|
530
|
+
"admitted int\n",
|
|
531
|
+
"degrees_const_func_ float\n",
|
|
532
|
+
"\n",
|
|
533
|
+
"\n",
|
|
534
|
+
"\n",
|
|
535
|
+
" 'degrees_const_func_' Column Type: FLOAT\n"
|
|
536
|
+
]
|
|
537
|
+
}
|
|
538
|
+
],
|
|
539
|
+
"source": [
|
|
540
|
+
"# Use case 1 for Degrees - Convert 1 radians to degrees\n",
|
|
541
|
+
"df = admissions_train.assign(degrees_const_func_ = func.degrees(1))\n",
|
|
542
|
+
"print_variables(df, \"degrees_const_func_\")"
|
|
543
|
+
]
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
"cell_type": "code",
|
|
547
|
+
"execution_count": 18,
|
|
548
|
+
"metadata": {},
|
|
549
|
+
"outputs": [
|
|
550
|
+
{
|
|
551
|
+
"name": "stdout",
|
|
552
|
+
"output_type": "stream",
|
|
553
|
+
"text": [
|
|
554
|
+
"Equivalent SQL: select id AS id, masters AS masters, gpa AS gpa, stats AS stats, programming AS programming, admitted AS admitted, degrees(admitted) AS degrees_admitted_func_ from \"admissions_train\"\n",
|
|
555
|
+
"\n",
|
|
556
|
+
"\n",
|
|
557
|
+
" ************************* DataFrame ********************* \n",
|
|
558
|
+
" masters gpa stats programming admitted degrees_admitted_func_\n",
|
|
559
|
+
"id \n",
|
|
560
|
+
"5 no 3.44 Novice Novice 0 0.00000\n",
|
|
561
|
+
"34 yes 3.85 Advanced Beginner 0 0.00000\n",
|
|
562
|
+
"13 no 4.00 Advanced Novice 1 57.29578\n",
|
|
563
|
+
"40 yes 3.95 Novice Beginner 0 0.00000\n",
|
|
564
|
+
"22 yes 3.46 Novice Beginner 0 0.00000\n",
|
|
565
|
+
"19 yes 1.98 Advanced Advanced 0 0.00000\n",
|
|
566
|
+
"36 no 3.00 Advanced Novice 0 0.00000\n",
|
|
567
|
+
"15 yes 4.00 Advanced Advanced 1 57.29578\n",
|
|
568
|
+
"7 yes 2.33 Novice Novice 1 57.29578\n",
|
|
569
|
+
"17 no 3.83 Advanced Advanced 1 57.29578\n",
|
|
570
|
+
"\n",
|
|
571
|
+
"\n",
|
|
572
|
+
"\n",
|
|
573
|
+
" ************************* DataFrame.dtypes ********************* \n",
|
|
574
|
+
"id int\n",
|
|
575
|
+
"masters str\n",
|
|
576
|
+
"gpa float\n",
|
|
577
|
+
"stats str\n",
|
|
578
|
+
"programming str\n",
|
|
579
|
+
"admitted int\n",
|
|
580
|
+
"degrees_admitted_func_ float\n",
|
|
581
|
+
"\n",
|
|
582
|
+
"\n",
|
|
583
|
+
"\n",
|
|
584
|
+
" 'degrees_admitted_func_' Column Type: FLOAT\n"
|
|
585
|
+
]
|
|
586
|
+
}
|
|
587
|
+
],
|
|
588
|
+
"source": [
|
|
589
|
+
"# Use case 2 for Degrees - Convert values in admitted assuming they are in radians to degrees\n",
|
|
590
|
+
"df = admissions_train.assign(degrees_admitted_func_ = func.degrees(admissions_train.admitted.expression))\n",
|
|
591
|
+
"print_variables(df, \"degrees_admitted_func_\")"
|
|
592
|
+
]
|
|
593
|
+
},
|
|
594
|
+
{
|
|
595
|
+
"cell_type": "code",
|
|
596
|
+
"execution_count": 19,
|
|
597
|
+
"metadata": {},
|
|
598
|
+
"outputs": [],
|
|
599
|
+
"source": [
|
|
600
|
+
"# RADIANS takes a value specified in degrees and converts it to radians.\n",
|
|
601
|
+
"# Syntax:\n",
|
|
602
|
+
"# radians(column_expression/constant)"
|
|
603
|
+
]
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
"cell_type": "code",
|
|
607
|
+
"execution_count": 20,
|
|
608
|
+
"metadata": {},
|
|
609
|
+
"outputs": [
|
|
610
|
+
{
|
|
611
|
+
"name": "stdout",
|
|
612
|
+
"output_type": "stream",
|
|
613
|
+
"text": [
|
|
614
|
+
"Equivalent SQL: select id AS id, masters AS masters, gpa AS gpa, stats AS stats, programming AS programming, admitted AS admitted, radians(90) AS radians_const_func_ from \"admissions_train\"\n",
|
|
615
|
+
"\n",
|
|
616
|
+
"\n",
|
|
617
|
+
" ************************* DataFrame ********************* \n",
|
|
618
|
+
" masters gpa stats programming admitted radians_const_func_\n",
|
|
619
|
+
"id \n",
|
|
620
|
+
"15 yes 4.00 Advanced Advanced 1 1.570796\n",
|
|
621
|
+
"7 yes 2.33 Novice Novice 1 1.570796\n",
|
|
622
|
+
"22 yes 3.46 Novice Beginner 0 1.570796\n",
|
|
623
|
+
"17 no 3.83 Advanced Advanced 1 1.570796\n",
|
|
624
|
+
"13 no 4.00 Advanced Novice 1 1.570796\n",
|
|
625
|
+
"38 yes 2.65 Advanced Beginner 1 1.570796\n",
|
|
626
|
+
"26 yes 3.57 Advanced Advanced 1 1.570796\n",
|
|
627
|
+
"5 no 3.44 Novice Novice 0 1.570796\n",
|
|
628
|
+
"34 yes 3.85 Advanced Beginner 0 1.570796\n",
|
|
629
|
+
"40 yes 3.95 Novice Beginner 0 1.570796\n",
|
|
630
|
+
"\n",
|
|
631
|
+
"\n",
|
|
632
|
+
"\n",
|
|
633
|
+
" ************************* DataFrame.dtypes ********************* \n",
|
|
634
|
+
"id int\n",
|
|
635
|
+
"masters str\n",
|
|
636
|
+
"gpa float\n",
|
|
637
|
+
"stats str\n",
|
|
638
|
+
"programming str\n",
|
|
639
|
+
"admitted int\n",
|
|
640
|
+
"radians_const_func_ float\n",
|
|
641
|
+
"\n",
|
|
642
|
+
"\n",
|
|
643
|
+
"\n",
|
|
644
|
+
" 'radians_const_func_' Column Type: FLOAT\n"
|
|
645
|
+
]
|
|
646
|
+
}
|
|
647
|
+
],
|
|
648
|
+
"source": [
|
|
649
|
+
"# Use case 1 for Radians - Convert 90 degrees to radians\n",
|
|
650
|
+
"df = admissions_train.assign(radians_const_func_ = func.radians(90))\n",
|
|
651
|
+
"print_variables(df, \"radians_const_func_\")"
|
|
652
|
+
]
|
|
653
|
+
},
|
|
654
|
+
{
|
|
655
|
+
"cell_type": "code",
|
|
656
|
+
"execution_count": 21,
|
|
657
|
+
"metadata": {},
|
|
658
|
+
"outputs": [
|
|
659
|
+
{
|
|
660
|
+
"name": "stdout",
|
|
661
|
+
"output_type": "stream",
|
|
662
|
+
"text": [
|
|
663
|
+
"Equivalent SQL: select id AS id, masters AS masters, gpa AS gpa, stats AS stats, programming AS programming, admitted AS admitted, RADIANS(admitted) AS radians_admitted_func_ from \"admissions_train\"\n",
|
|
664
|
+
"\n",
|
|
665
|
+
"\n",
|
|
666
|
+
" ************************* DataFrame ********************* \n",
|
|
667
|
+
" masters gpa stats programming admitted radians_admitted_func_\n",
|
|
668
|
+
"id \n",
|
|
669
|
+
"5 no 3.44 Novice Novice 0 0.000000\n",
|
|
670
|
+
"34 yes 3.85 Advanced Beginner 0 0.000000\n",
|
|
671
|
+
"13 no 4.00 Advanced Novice 1 0.017453\n",
|
|
672
|
+
"40 yes 3.95 Novice Beginner 0 0.000000\n",
|
|
673
|
+
"22 yes 3.46 Novice Beginner 0 0.000000\n",
|
|
674
|
+
"19 yes 1.98 Advanced Advanced 0 0.000000\n",
|
|
675
|
+
"36 no 3.00 Advanced Novice 0 0.000000\n",
|
|
676
|
+
"15 yes 4.00 Advanced Advanced 1 0.017453\n",
|
|
677
|
+
"7 yes 2.33 Novice Novice 1 0.017453\n",
|
|
678
|
+
"17 no 3.83 Advanced Advanced 1 0.017453\n",
|
|
679
|
+
"\n",
|
|
680
|
+
"\n",
|
|
681
|
+
"\n",
|
|
682
|
+
" ************************* DataFrame.dtypes ********************* \n",
|
|
683
|
+
"id int\n",
|
|
684
|
+
"masters str\n",
|
|
685
|
+
"gpa float\n",
|
|
686
|
+
"stats str\n",
|
|
687
|
+
"programming str\n",
|
|
688
|
+
"admitted int\n",
|
|
689
|
+
"radians_admitted_func_ float\n",
|
|
690
|
+
"\n",
|
|
691
|
+
"\n",
|
|
692
|
+
"\n",
|
|
693
|
+
" 'radians_admitted_func_' Column Type: FLOAT\n"
|
|
694
|
+
]
|
|
695
|
+
}
|
|
696
|
+
],
|
|
697
|
+
"source": [
|
|
698
|
+
"# Use case 2 for Degrees - Convert values in gpa assuming they are in degrees to radians\n",
|
|
699
|
+
"df = admissions_train.assign(radians_admitted_func_ = func.RADIANS(admissions_train.admitted.expression))\n",
|
|
700
|
+
"print_variables(df, \"radians_admitted_func_\")"
|
|
701
|
+
]
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
"cell_type": "markdown",
|
|
705
|
+
"metadata": {},
|
|
706
|
+
"source": [
|
|
707
|
+
"### EXP function"
|
|
708
|
+
]
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
"cell_type": "code",
|
|
712
|
+
"execution_count": 22,
|
|
713
|
+
"metadata": {},
|
|
714
|
+
"outputs": [],
|
|
715
|
+
"source": [
|
|
716
|
+
"# Function raises e (the base of natural logarithms) to the power of the argument, where e = 2.71828182845905.\n",
|
|
717
|
+
"# Syntax: \n",
|
|
718
|
+
"# exp(column_expression/constant)"
|
|
719
|
+
]
|
|
720
|
+
},
|
|
721
|
+
{
|
|
722
|
+
"cell_type": "code",
|
|
723
|
+
"execution_count": 23,
|
|
724
|
+
"metadata": {},
|
|
725
|
+
"outputs": [
|
|
726
|
+
{
|
|
727
|
+
"name": "stdout",
|
|
728
|
+
"output_type": "stream",
|
|
729
|
+
"text": [
|
|
730
|
+
"Equivalent SQL: select id AS id, masters AS masters, gpa AS gpa, stats AS stats, programming AS programming, admitted AS admitted, exp(admitted) AS exp_admitted_func_ from \"admissions_train\"\n",
|
|
731
|
+
"\n",
|
|
732
|
+
"\n",
|
|
733
|
+
" ************************* DataFrame ********************* \n",
|
|
734
|
+
" masters gpa stats programming admitted exp_admitted_func_\n",
|
|
735
|
+
"id \n",
|
|
736
|
+
"15 yes 4.00 Advanced Advanced 1 2.718282\n",
|
|
737
|
+
"7 yes 2.33 Novice Novice 1 2.718282\n",
|
|
738
|
+
"22 yes 3.46 Novice Beginner 0 1.000000\n",
|
|
739
|
+
"17 no 3.83 Advanced Advanced 1 2.718282\n",
|
|
740
|
+
"13 no 4.00 Advanced Novice 1 2.718282\n",
|
|
741
|
+
"38 yes 2.65 Advanced Beginner 1 2.718282\n",
|
|
742
|
+
"26 yes 3.57 Advanced Advanced 1 2.718282\n",
|
|
743
|
+
"5 no 3.44 Novice Novice 0 1.000000\n",
|
|
744
|
+
"34 yes 3.85 Advanced Beginner 0 1.000000\n",
|
|
745
|
+
"40 yes 3.95 Novice Beginner 0 1.000000\n",
|
|
746
|
+
"\n",
|
|
747
|
+
"\n",
|
|
748
|
+
"\n",
|
|
749
|
+
" ************************* DataFrame.dtypes ********************* \n",
|
|
750
|
+
"id int\n",
|
|
751
|
+
"masters str\n",
|
|
752
|
+
"gpa float\n",
|
|
753
|
+
"stats str\n",
|
|
754
|
+
"programming str\n",
|
|
755
|
+
"admitted int\n",
|
|
756
|
+
"exp_admitted_func_ float\n",
|
|
757
|
+
"\n",
|
|
758
|
+
"\n",
|
|
759
|
+
"\n",
|
|
760
|
+
" 'exp_admitted_func_' Column Type: FLOAT\n"
|
|
761
|
+
]
|
|
762
|
+
}
|
|
763
|
+
],
|
|
764
|
+
"source": [
|
|
765
|
+
"# Use case 1: Calculate exp of values in column admitted\n",
|
|
766
|
+
"df = admissions_train.assign(exp_admitted_func_ = func.exp(admissions_train.admitted.expression))\n",
|
|
767
|
+
"print_variables(df, \"exp_admitted_func_\")"
|
|
768
|
+
]
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
"cell_type": "code",
|
|
772
|
+
"execution_count": 24,
|
|
773
|
+
"metadata": {},
|
|
774
|
+
"outputs": [
|
|
775
|
+
{
|
|
776
|
+
"name": "stdout",
|
|
777
|
+
"output_type": "stream",
|
|
778
|
+
"text": [
|
|
779
|
+
"Equivalent SQL: select id AS id, masters AS masters, gpa AS gpa, stats AS stats, programming AS programming, admitted AS admitted, exp(admitted) AS exp_const_func_ from \"admissions_train\"\n",
|
|
780
|
+
"\n",
|
|
781
|
+
"\n",
|
|
782
|
+
" ************************* DataFrame ********************* \n",
|
|
783
|
+
" masters gpa stats programming admitted exp_const_func_\n",
|
|
784
|
+
"id \n",
|
|
785
|
+
"5 no 3.44 Novice Novice 0 1.000000\n",
|
|
786
|
+
"34 yes 3.85 Advanced Beginner 0 1.000000\n",
|
|
787
|
+
"13 no 4.00 Advanced Novice 1 2.718282\n",
|
|
788
|
+
"40 yes 3.95 Novice Beginner 0 1.000000\n",
|
|
789
|
+
"22 yes 3.46 Novice Beginner 0 1.000000\n",
|
|
790
|
+
"19 yes 1.98 Advanced Advanced 0 1.000000\n",
|
|
791
|
+
"36 no 3.00 Advanced Novice 0 1.000000\n",
|
|
792
|
+
"15 yes 4.00 Advanced Advanced 1 2.718282\n",
|
|
793
|
+
"7 yes 2.33 Novice Novice 1 2.718282\n",
|
|
794
|
+
"17 no 3.83 Advanced Advanced 1 2.718282\n",
|
|
795
|
+
"\n",
|
|
796
|
+
"\n",
|
|
797
|
+
"\n",
|
|
798
|
+
" ************************* DataFrame.dtypes ********************* \n",
|
|
799
|
+
"id int\n",
|
|
800
|
+
"masters str\n",
|
|
801
|
+
"gpa float\n",
|
|
802
|
+
"stats str\n",
|
|
803
|
+
"programming str\n",
|
|
804
|
+
"admitted int\n",
|
|
805
|
+
"exp_const_func_ float\n",
|
|
806
|
+
"\n",
|
|
807
|
+
"\n",
|
|
808
|
+
"\n",
|
|
809
|
+
" 'exp_const_func_' Column Type: FLOAT\n"
|
|
810
|
+
]
|
|
811
|
+
}
|
|
812
|
+
],
|
|
813
|
+
"source": [
|
|
814
|
+
"# Use case 2: Calculate exp of 2\n",
|
|
815
|
+
"df = admissions_train.assign(exp_const_func_ = func.exp(admissions_train.admitted.expression))\n",
|
|
816
|
+
"print_variables(df, \"exp_const_func_\")"
|
|
817
|
+
]
|
|
818
|
+
},
|
|
819
|
+
{
|
|
820
|
+
"cell_type": "markdown",
|
|
821
|
+
"metadata": {},
|
|
822
|
+
"source": [
|
|
823
|
+
"### FLOOR Function"
|
|
824
|
+
]
|
|
825
|
+
},
|
|
826
|
+
{
|
|
827
|
+
"cell_type": "code",
|
|
828
|
+
"execution_count": 25,
|
|
829
|
+
"metadata": {},
|
|
830
|
+
"outputs": [],
|
|
831
|
+
"source": [
|
|
832
|
+
"# Function returns the largest integer equal to or less than the input argument.\n",
|
|
833
|
+
"# Syntax:\n",
|
|
834
|
+
"# floor(column_expression/constant)"
|
|
835
|
+
]
|
|
836
|
+
},
|
|
837
|
+
{
|
|
838
|
+
"cell_type": "code",
|
|
839
|
+
"execution_count": 26,
|
|
840
|
+
"metadata": {},
|
|
841
|
+
"outputs": [
|
|
842
|
+
{
|
|
843
|
+
"name": "stdout",
|
|
844
|
+
"output_type": "stream",
|
|
845
|
+
"text": [
|
|
846
|
+
"Equivalent SQL: select id AS id, masters AS masters, gpa AS gpa, stats AS stats, programming AS programming, admitted AS admitted, floor(gpa) AS floor_gpa_func_ from \"admissions_train\"\n",
|
|
847
|
+
"\n",
|
|
848
|
+
"\n",
|
|
849
|
+
" ************************* DataFrame ********************* \n",
|
|
850
|
+
" masters gpa stats programming admitted floor_gpa_func_\n",
|
|
851
|
+
"id \n",
|
|
852
|
+
"22 yes 3.46 Novice Beginner 0 3.0\n",
|
|
853
|
+
"36 no 3.00 Advanced Novice 0 3.0\n",
|
|
854
|
+
"15 yes 4.00 Advanced Advanced 1 4.0\n",
|
|
855
|
+
"38 yes 2.65 Advanced Beginner 1 2.0\n",
|
|
856
|
+
"5 no 3.44 Novice Novice 0 3.0\n",
|
|
857
|
+
"17 no 3.83 Advanced Advanced 1 3.0\n",
|
|
858
|
+
"34 yes 3.85 Advanced Beginner 0 3.0\n",
|
|
859
|
+
"13 no 4.00 Advanced Novice 1 4.0\n",
|
|
860
|
+
"26 yes 3.57 Advanced Advanced 1 3.0\n",
|
|
861
|
+
"19 yes 1.98 Advanced Advanced 0 1.0\n",
|
|
862
|
+
"\n",
|
|
863
|
+
"\n",
|
|
864
|
+
"\n",
|
|
865
|
+
" ************************* DataFrame.dtypes ********************* \n",
|
|
866
|
+
"id int\n",
|
|
867
|
+
"masters str\n",
|
|
868
|
+
"gpa float\n",
|
|
869
|
+
"stats str\n",
|
|
870
|
+
"programming str\n",
|
|
871
|
+
"admitted int\n",
|
|
872
|
+
"floor_gpa_func_ float\n",
|
|
873
|
+
"\n",
|
|
874
|
+
"\n",
|
|
875
|
+
"\n",
|
|
876
|
+
" 'floor_gpa_func_' Column Type: FLOAT\n"
|
|
877
|
+
]
|
|
878
|
+
}
|
|
879
|
+
],
|
|
880
|
+
"source": [
|
|
881
|
+
"# Use case: Calculate floor of values in column gpa \n",
|
|
882
|
+
"df = admissions_train.assign(floor_gpa_func_ = func.floor(admissions_train.gpa.expression))\n",
|
|
883
|
+
"print_variables(df, \"floor_gpa_func_\")"
|
|
884
|
+
]
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
"cell_type": "code",
|
|
888
|
+
"execution_count": 27,
|
|
889
|
+
"metadata": {},
|
|
890
|
+
"outputs": [
|
|
891
|
+
{
|
|
892
|
+
"name": "stdout",
|
|
893
|
+
"output_type": "stream",
|
|
894
|
+
"text": [
|
|
895
|
+
"Equivalent SQL: select id AS id, masters AS masters, gpa AS gpa, stats AS stats, programming AS programming, admitted AS admitted, FLOOR(2.43) AS floor_gpa_func_ from \"admissions_train\"\n",
|
|
896
|
+
"\n",
|
|
897
|
+
"\n",
|
|
898
|
+
" ************************* DataFrame ********************* \n",
|
|
899
|
+
" masters gpa stats programming admitted floor_gpa_func_\n",
|
|
900
|
+
"id \n",
|
|
901
|
+
"5 no 3.44 Novice Novice 0 2.0\n",
|
|
902
|
+
"34 yes 3.85 Advanced Beginner 0 2.0\n",
|
|
903
|
+
"13 no 4.00 Advanced Novice 1 2.0\n",
|
|
904
|
+
"40 yes 3.95 Novice Beginner 0 2.0\n",
|
|
905
|
+
"22 yes 3.46 Novice Beginner 0 2.0\n",
|
|
906
|
+
"19 yes 1.98 Advanced Advanced 0 2.0\n",
|
|
907
|
+
"36 no 3.00 Advanced Novice 0 2.0\n",
|
|
908
|
+
"15 yes 4.00 Advanced Advanced 1 2.0\n",
|
|
909
|
+
"7 yes 2.33 Novice Novice 1 2.0\n",
|
|
910
|
+
"17 no 3.83 Advanced Advanced 1 2.0\n",
|
|
911
|
+
"\n",
|
|
912
|
+
"\n",
|
|
913
|
+
"\n",
|
|
914
|
+
" ************************* DataFrame.dtypes ********************* \n",
|
|
915
|
+
"id int\n",
|
|
916
|
+
"masters str\n",
|
|
917
|
+
"gpa float\n",
|
|
918
|
+
"stats str\n",
|
|
919
|
+
"programming str\n",
|
|
920
|
+
"admitted int\n",
|
|
921
|
+
"floor_gpa_func_ float\n",
|
|
922
|
+
"\n",
|
|
923
|
+
"\n",
|
|
924
|
+
"\n",
|
|
925
|
+
" 'floor_gpa_func_' Column Type: FLOAT\n"
|
|
926
|
+
]
|
|
927
|
+
}
|
|
928
|
+
],
|
|
929
|
+
"source": [
|
|
930
|
+
"# Use case: Calculate floor of constant value 2.43\n",
|
|
931
|
+
"df = admissions_train.assign(floor_gpa_func_ = func.FLOOR(2.43))\n",
|
|
932
|
+
"print_variables(df, \"floor_gpa_func_\")"
|
|
933
|
+
]
|
|
934
|
+
},
|
|
935
|
+
{
|
|
936
|
+
"cell_type": "markdown",
|
|
937
|
+
"metadata": {},
|
|
938
|
+
"source": [
|
|
939
|
+
"### Hyperbolic Functions"
|
|
940
|
+
]
|
|
941
|
+
},
|
|
942
|
+
{
|
|
943
|
+
"cell_type": "code",
|
|
944
|
+
"execution_count": 28,
|
|
945
|
+
"metadata": {},
|
|
946
|
+
"outputs": [],
|
|
947
|
+
"source": [
|
|
948
|
+
"# These functions perform the hyperbolic or inverse hyperbolic function of an argument.\n",
|
|
949
|
+
"# Following hyperbolic function are available:\n",
|
|
950
|
+
"# - COSH(column_expression/constant)\n",
|
|
951
|
+
"# - SINH(column_expression/constant)\n",
|
|
952
|
+
"# - TANH(column_expression/constant)\n",
|
|
953
|
+
"# - ACOSH(column_expression/constant)\n",
|
|
954
|
+
"# - ASINH(column_expression/constant)\n",
|
|
955
|
+
"# - ATANH(column_expression/constant)"
|
|
956
|
+
]
|
|
957
|
+
},
|
|
958
|
+
{
|
|
959
|
+
"cell_type": "code",
|
|
960
|
+
"execution_count": 29,
|
|
961
|
+
"metadata": {},
|
|
962
|
+
"outputs": [
|
|
963
|
+
{
|
|
964
|
+
"name": "stdout",
|
|
965
|
+
"output_type": "stream",
|
|
966
|
+
"text": [
|
|
967
|
+
"Equivalent SQL: select id AS id, masters AS masters, gpa AS gpa, stats AS stats, programming AS programming, admitted AS admitted, ASINH(sinh(gpa)) AS asinh_gpa_func_, sinh(gpa) AS sinh_gpa_func_ from \"admissions_train\"\n",
|
|
968
|
+
"\n",
|
|
969
|
+
"\n",
|
|
970
|
+
" ************************* DataFrame ********************* \n",
|
|
971
|
+
" masters gpa stats programming admitted asinh_gpa_func_ sinh_gpa_func_\n",
|
|
972
|
+
"id \n",
|
|
973
|
+
"22 yes 3.46 Novice Beginner 0 3.46 15.892773\n",
|
|
974
|
+
"36 no 3.00 Advanced Novice 0 3.00 10.017875\n",
|
|
975
|
+
"15 yes 4.00 Advanced Advanced 1 4.00 27.289917\n",
|
|
976
|
+
"38 yes 2.65 Advanced Beginner 1 2.65 7.041694\n",
|
|
977
|
+
"5 no 3.44 Novice Novice 0 3.44 15.577447\n",
|
|
978
|
+
"17 no 3.83 Advanced Advanced 1 3.83 23.020414\n",
|
|
979
|
+
"34 yes 3.85 Advanced Beginner 0 3.85 23.485892\n",
|
|
980
|
+
"13 no 4.00 Advanced Novice 1 4.00 27.289917\n",
|
|
981
|
+
"26 yes 3.57 Advanced Advanced 1 3.57 17.744219\n",
|
|
982
|
+
"19 yes 1.98 Advanced Advanced 0 1.98 3.552337\n",
|
|
983
|
+
"\n",
|
|
984
|
+
"\n",
|
|
985
|
+
"\n",
|
|
986
|
+
" ************************* DataFrame.dtypes ********************* \n",
|
|
987
|
+
"id int\n",
|
|
988
|
+
"masters str\n",
|
|
989
|
+
"gpa float\n",
|
|
990
|
+
"stats str\n",
|
|
991
|
+
"programming str\n",
|
|
992
|
+
"admitted int\n",
|
|
993
|
+
"asinh_gpa_func_ float\n",
|
|
994
|
+
"sinh_gpa_func_ float\n",
|
|
995
|
+
"\n",
|
|
996
|
+
"\n",
|
|
997
|
+
"\n",
|
|
998
|
+
" 'sinh_gpa_func_' Column Type: FLOAT\n",
|
|
999
|
+
" 'asinh_gpa_func_' Column Type: FLOAT\n"
|
|
1000
|
+
]
|
|
1001
|
+
}
|
|
1002
|
+
],
|
|
1003
|
+
"source": [
|
|
1004
|
+
"# Use case for SINH and ASINH functions, other functions can also be used in similar way\n",
|
|
1005
|
+
"df = admissions_train.assign(sinh_gpa_func_ = func.sinh(admissions_train.gpa.expression), \n",
|
|
1006
|
+
" asinh_gpa_func_ = func.ASINH(func.sinh(admissions_train.gpa.expression)))\n",
|
|
1007
|
+
"print_variables(df, [\"sinh_gpa_func_\", \"asinh_gpa_func_\"])"
|
|
1008
|
+
]
|
|
1009
|
+
},
|
|
1010
|
+
{
|
|
1011
|
+
"cell_type": "markdown",
|
|
1012
|
+
"metadata": {},
|
|
1013
|
+
"source": [
|
|
1014
|
+
"## Logarithmic Functions"
|
|
1015
|
+
]
|
|
1016
|
+
},
|
|
1017
|
+
{
|
|
1018
|
+
"cell_type": "markdown",
|
|
1019
|
+
"metadata": {},
|
|
1020
|
+
"source": [
|
|
1021
|
+
"### LN fucntion"
|
|
1022
|
+
]
|
|
1023
|
+
},
|
|
1024
|
+
{
|
|
1025
|
+
"cell_type": "code",
|
|
1026
|
+
"execution_count": 30,
|
|
1027
|
+
"metadata": {},
|
|
1028
|
+
"outputs": [],
|
|
1029
|
+
"source": [
|
|
1030
|
+
"# Compute the natural logarithm of the argument. \n",
|
|
1031
|
+
"# Syntax:\n",
|
|
1032
|
+
"# ln(column_expression/constant)"
|
|
1033
|
+
]
|
|
1034
|
+
},
|
|
1035
|
+
{
|
|
1036
|
+
"cell_type": "code",
|
|
1037
|
+
"execution_count": 31,
|
|
1038
|
+
"metadata": {},
|
|
1039
|
+
"outputs": [
|
|
1040
|
+
{
|
|
1041
|
+
"name": "stdout",
|
|
1042
|
+
"output_type": "stream",
|
|
1043
|
+
"text": [
|
|
1044
|
+
"Equivalent SQL: select id AS id, masters AS masters, gpa AS gpa, stats AS stats, programming AS programming, admitted AS admitted, LN(10) AS natural_log_const_func_, LN(gpa) AS natural_log_gpa_func_ from \"admissions_train\"\n",
|
|
1045
|
+
"\n",
|
|
1046
|
+
"\n",
|
|
1047
|
+
" ************************* DataFrame ********************* \n",
|
|
1048
|
+
" masters gpa stats programming admitted natural_log_const_func_ natural_log_gpa_func_\n",
|
|
1049
|
+
"id \n",
|
|
1050
|
+
"5 no 3.44 Novice Novice 0 2.302585 1.235471\n",
|
|
1051
|
+
"7 yes 2.33 Novice Novice 1 2.302585 0.845868\n",
|
|
1052
|
+
"22 yes 3.46 Novice Beginner 0 2.302585 1.241269\n",
|
|
1053
|
+
"19 yes 1.98 Advanced Advanced 0 2.302585 0.683097\n",
|
|
1054
|
+
"15 yes 4.00 Advanced Advanced 1 2.302585 1.386294\n",
|
|
1055
|
+
"17 no 3.83 Advanced Advanced 1 2.302585 1.342865\n",
|
|
1056
|
+
"34 yes 3.85 Advanced Beginner 0 2.302585 1.348073\n",
|
|
1057
|
+
"13 no 4.00 Advanced Novice 1 2.302585 1.386294\n",
|
|
1058
|
+
"36 no 3.00 Advanced Novice 0 2.302585 1.098612\n",
|
|
1059
|
+
"40 yes 3.95 Novice Beginner 0 2.302585 1.373716\n",
|
|
1060
|
+
"\n",
|
|
1061
|
+
"\n",
|
|
1062
|
+
"\n",
|
|
1063
|
+
" ************************* DataFrame.dtypes ********************* \n",
|
|
1064
|
+
"id int\n",
|
|
1065
|
+
"masters str\n",
|
|
1066
|
+
"gpa float\n",
|
|
1067
|
+
"stats str\n",
|
|
1068
|
+
"programming str\n",
|
|
1069
|
+
"admitted int\n",
|
|
1070
|
+
"natural_log_const_func_ float\n",
|
|
1071
|
+
"natural_log_gpa_func_ float\n",
|
|
1072
|
+
"\n",
|
|
1073
|
+
"\n",
|
|
1074
|
+
"\n",
|
|
1075
|
+
" 'natural_log_gpa_func_' Column Type: FLOAT\n",
|
|
1076
|
+
" 'natural_log_const_func_' Column Type: FLOAT\n"
|
|
1077
|
+
]
|
|
1078
|
+
}
|
|
1079
|
+
],
|
|
1080
|
+
"source": [
|
|
1081
|
+
"# Compute natural logarithm of values in gpa and a constant 10\n",
|
|
1082
|
+
"df = admissions_train.assign(natural_log_gpa_func_ = func.LN(admissions_train.gpa.expression),\n",
|
|
1083
|
+
" natural_log_const_func_ = func.LN(10))\n",
|
|
1084
|
+
"print_variables(df, [\"natural_log_gpa_func_\", \"natural_log_const_func_\"])"
|
|
1085
|
+
]
|
|
1086
|
+
},
|
|
1087
|
+
{
|
|
1088
|
+
"cell_type": "markdown",
|
|
1089
|
+
"metadata": {},
|
|
1090
|
+
"source": [
|
|
1091
|
+
"### LOG function"
|
|
1092
|
+
]
|
|
1093
|
+
},
|
|
1094
|
+
{
|
|
1095
|
+
"cell_type": "code",
|
|
1096
|
+
"execution_count": 32,
|
|
1097
|
+
"metadata": {},
|
|
1098
|
+
"outputs": [],
|
|
1099
|
+
"source": [
|
|
1100
|
+
"# Function computes the base 10 logarithm of an argument.\n",
|
|
1101
|
+
"# Syntax:\n",
|
|
1102
|
+
"# LOG(column_expression/constant)"
|
|
1103
|
+
]
|
|
1104
|
+
},
|
|
1105
|
+
{
|
|
1106
|
+
"cell_type": "code",
|
|
1107
|
+
"execution_count": 33,
|
|
1108
|
+
"metadata": {},
|
|
1109
|
+
"outputs": [
|
|
1110
|
+
{
|
|
1111
|
+
"name": "stdout",
|
|
1112
|
+
"output_type": "stream",
|
|
1113
|
+
"text": [
|
|
1114
|
+
"Equivalent SQL: select id AS id, masters AS masters, gpa AS gpa, stats AS stats, programming AS programming, admitted AS admitted, log(10) AS log_const_func, Log(gpa * 10) AS log_gpa_func_ from \"admissions_train\"\n",
|
|
1115
|
+
"\n",
|
|
1116
|
+
"\n",
|
|
1117
|
+
" ************************* DataFrame ********************* \n",
|
|
1118
|
+
" masters gpa stats programming admitted log_const_func log_gpa_func_\n",
|
|
1119
|
+
"id \n",
|
|
1120
|
+
"22 yes 3.46 Novice Beginner 0 1.0 1.539076\n",
|
|
1121
|
+
"26 yes 3.57 Advanced Advanced 1 1.0 1.552668\n",
|
|
1122
|
+
"5 no 3.44 Novice Novice 0 1.0 1.536558\n",
|
|
1123
|
+
"17 no 3.83 Advanced Advanced 1 1.0 1.583199\n",
|
|
1124
|
+
"13 no 4.00 Advanced Novice 1 1.0 1.602060\n",
|
|
1125
|
+
"19 yes 1.98 Advanced Advanced 0 1.0 1.296665\n",
|
|
1126
|
+
"36 no 3.00 Advanced Novice 0 1.0 1.477121\n",
|
|
1127
|
+
"15 yes 4.00 Advanced Advanced 1 1.0 1.602060\n",
|
|
1128
|
+
"34 yes 3.85 Advanced Beginner 0 1.0 1.585461\n",
|
|
1129
|
+
"38 yes 2.65 Advanced Beginner 1 1.0 1.423246\n",
|
|
1130
|
+
"\n",
|
|
1131
|
+
"\n",
|
|
1132
|
+
"\n",
|
|
1133
|
+
" ************************* DataFrame.dtypes ********************* \n",
|
|
1134
|
+
"id int\n",
|
|
1135
|
+
"masters str\n",
|
|
1136
|
+
"gpa float\n",
|
|
1137
|
+
"stats str\n",
|
|
1138
|
+
"programming str\n",
|
|
1139
|
+
"admitted int\n",
|
|
1140
|
+
"log_const_func float\n",
|
|
1141
|
+
"log_gpa_func_ float\n",
|
|
1142
|
+
"\n",
|
|
1143
|
+
"\n",
|
|
1144
|
+
"\n",
|
|
1145
|
+
" 'log_gpa_func_' Column Type: FLOAT\n",
|
|
1146
|
+
" 'log_const_func' Column Type: FLOAT\n"
|
|
1147
|
+
]
|
|
1148
|
+
}
|
|
1149
|
+
],
|
|
1150
|
+
"source": [
|
|
1151
|
+
"# Compute natural logarithm of values in gpa * 10 and a constant 10\n",
|
|
1152
|
+
"df = admissions_train.assign(log_gpa_func_ = func.Log(admissions_train.gpa.expression * 10),\n",
|
|
1153
|
+
" log_const_func = func.log(10))\n",
|
|
1154
|
+
"print_variables(df, [\"log_gpa_func_\", \"log_const_func\"])"
|
|
1155
|
+
]
|
|
1156
|
+
},
|
|
1157
|
+
{
|
|
1158
|
+
"cell_type": "markdown",
|
|
1159
|
+
"metadata": {},
|
|
1160
|
+
"source": [
|
|
1161
|
+
"### MOD Function"
|
|
1162
|
+
]
|
|
1163
|
+
},
|
|
1164
|
+
{
|
|
1165
|
+
"cell_type": "code",
|
|
1166
|
+
"execution_count": 34,
|
|
1167
|
+
"metadata": {},
|
|
1168
|
+
"outputs": [],
|
|
1169
|
+
"source": [
|
|
1170
|
+
"# Function returns the remainder (modulus) of expr1 divided by expr2.\n",
|
|
1171
|
+
"# Syntax:\n",
|
|
1172
|
+
"# MOD(expr1, expr2)\n",
|
|
1173
|
+
"# Where, \n",
|
|
1174
|
+
"# expr1 and expr2 can be column_expression or a constant"
|
|
1175
|
+
]
|
|
1176
|
+
},
|
|
1177
|
+
{
|
|
1178
|
+
"cell_type": "code",
|
|
1179
|
+
"execution_count": 35,
|
|
1180
|
+
"metadata": {},
|
|
1181
|
+
"outputs": [
|
|
1182
|
+
{
|
|
1183
|
+
"name": "stdout",
|
|
1184
|
+
"output_type": "stream",
|
|
1185
|
+
"text": [
|
|
1186
|
+
"Equivalent SQL: select id AS id, masters AS masters, gpa AS gpa, stats AS stats, programming AS programming, admitted AS admitted, MOD(12, gpa) AS modgpa12, mod(gpa, 2) AS modgpa2 from \"admissions_train\"\n",
|
|
1187
|
+
"\n",
|
|
1188
|
+
"\n",
|
|
1189
|
+
" ************************* DataFrame ********************* \n",
|
|
1190
|
+
" masters gpa stats programming admitted modgpa12 modgpa2\n",
|
|
1191
|
+
"id \n",
|
|
1192
|
+
"5 no 3.44 Novice Novice 0 1.68 1.44\n",
|
|
1193
|
+
"34 yes 3.85 Advanced Beginner 0 0.45 1.85\n",
|
|
1194
|
+
"13 no 4.00 Advanced Novice 1 0.00 0.00\n",
|
|
1195
|
+
"40 yes 3.95 Novice Beginner 0 0.15 1.95\n",
|
|
1196
|
+
"22 yes 3.46 Novice Beginner 0 1.62 1.46\n",
|
|
1197
|
+
"19 yes 1.98 Advanced Advanced 0 0.12 1.98\n",
|
|
1198
|
+
"36 no 3.00 Advanced Novice 0 0.00 1.00\n",
|
|
1199
|
+
"15 yes 4.00 Advanced Advanced 1 0.00 0.00\n",
|
|
1200
|
+
"7 yes 2.33 Novice Novice 1 0.35 0.33\n",
|
|
1201
|
+
"17 no 3.83 Advanced Advanced 1 0.51 1.83\n",
|
|
1202
|
+
"\n",
|
|
1203
|
+
"\n",
|
|
1204
|
+
"\n",
|
|
1205
|
+
" ************************* DataFrame.dtypes ********************* \n",
|
|
1206
|
+
"id int\n",
|
|
1207
|
+
"masters str\n",
|
|
1208
|
+
"gpa float\n",
|
|
1209
|
+
"stats str\n",
|
|
1210
|
+
"programming str\n",
|
|
1211
|
+
"admitted int\n",
|
|
1212
|
+
"modgpa12 float\n",
|
|
1213
|
+
"modgpa2 float\n",
|
|
1214
|
+
"\n",
|
|
1215
|
+
"\n",
|
|
1216
|
+
"\n",
|
|
1217
|
+
" 'modgpa2' Column Type: FLOAT\n",
|
|
1218
|
+
" 'modgpa12' Column Type: FLOAT\n"
|
|
1219
|
+
]
|
|
1220
|
+
}
|
|
1221
|
+
],
|
|
1222
|
+
"source": [
|
|
1223
|
+
"# Use case for MOD function\n",
|
|
1224
|
+
"df = admissions_train.assign(modgpa2 = func.mod(admissions_train.gpa.expression, 2),\n",
|
|
1225
|
+
" modgpa12 = func.MOD(12, admissions_train.gpa.expression),)\n",
|
|
1226
|
+
"print_variables(df, [\"modgpa2\", \"modgpa12\"])"
|
|
1227
|
+
]
|
|
1228
|
+
},
|
|
1229
|
+
{
|
|
1230
|
+
"cell_type": "markdown",
|
|
1231
|
+
"metadata": {},
|
|
1232
|
+
"source": [
|
|
1233
|
+
"## NULL to 0 and vice versa conversion functions"
|
|
1234
|
+
]
|
|
1235
|
+
},
|
|
1236
|
+
{
|
|
1237
|
+
"cell_type": "markdown",
|
|
1238
|
+
"metadata": {},
|
|
1239
|
+
"source": [
|
|
1240
|
+
"### NULLIFZERO functions"
|
|
1241
|
+
]
|
|
1242
|
+
},
|
|
1243
|
+
{
|
|
1244
|
+
"cell_type": "code",
|
|
1245
|
+
"execution_count": 36,
|
|
1246
|
+
"metadata": {},
|
|
1247
|
+
"outputs": [],
|
|
1248
|
+
"source": [
|
|
1249
|
+
"# Function converts data from zero to null to avoid problems with division by zero.\n",
|
|
1250
|
+
"# Syntax:\n",
|
|
1251
|
+
"# NULLIFZERO(expr)\n",
|
|
1252
|
+
"# Where, \n",
|
|
1253
|
+
"# expr - can be column_expression or a constant"
|
|
1254
|
+
]
|
|
1255
|
+
},
|
|
1256
|
+
{
|
|
1257
|
+
"cell_type": "code",
|
|
1258
|
+
"execution_count": 37,
|
|
1259
|
+
"metadata": {},
|
|
1260
|
+
"outputs": [
|
|
1261
|
+
{
|
|
1262
|
+
"name": "stdout",
|
|
1263
|
+
"output_type": "stream",
|
|
1264
|
+
"text": [
|
|
1265
|
+
"Equivalent SQL: select id AS id, masters AS masters, gpa AS gpa, stats AS stats, programming AS programming, admitted AS admitted, gpa / nullifzero(admitted) AS admitted_null_if_zero from \"admissions_train\"\n",
|
|
1266
|
+
"\n",
|
|
1267
|
+
"\n",
|
|
1268
|
+
" ************************* DataFrame ********************* \n",
|
|
1269
|
+
" masters gpa stats programming admitted admitted_null_if_zero\n",
|
|
1270
|
+
"id \n",
|
|
1271
|
+
"15 yes 4.00 Advanced Advanced 1 4.00\n",
|
|
1272
|
+
"7 yes 2.33 Novice Novice 1 2.33\n",
|
|
1273
|
+
"22 yes 3.46 Novice Beginner 0 NaN\n",
|
|
1274
|
+
"17 no 3.83 Advanced Advanced 1 3.83\n",
|
|
1275
|
+
"13 no 4.00 Advanced Novice 1 4.00\n",
|
|
1276
|
+
"38 yes 2.65 Advanced Beginner 1 2.65\n",
|
|
1277
|
+
"26 yes 3.57 Advanced Advanced 1 3.57\n",
|
|
1278
|
+
"5 no 3.44 Novice Novice 0 NaN\n",
|
|
1279
|
+
"34 yes 3.85 Advanced Beginner 0 NaN\n",
|
|
1280
|
+
"40 yes 3.95 Novice Beginner 0 NaN\n",
|
|
1281
|
+
"\n",
|
|
1282
|
+
"\n",
|
|
1283
|
+
"\n",
|
|
1284
|
+
" ************************* DataFrame.dtypes ********************* \n",
|
|
1285
|
+
"id int\n",
|
|
1286
|
+
"masters str\n",
|
|
1287
|
+
"gpa float\n",
|
|
1288
|
+
"stats str\n",
|
|
1289
|
+
"programming str\n",
|
|
1290
|
+
"admitted int\n",
|
|
1291
|
+
"admitted_null_if_zero float\n",
|
|
1292
|
+
"\n",
|
|
1293
|
+
"\n",
|
|
1294
|
+
"\n",
|
|
1295
|
+
" 'admitted_null_if_zero' Column Type: FLOAT\n"
|
|
1296
|
+
]
|
|
1297
|
+
}
|
|
1298
|
+
],
|
|
1299
|
+
"source": [
|
|
1300
|
+
"# Use case of NULLIFZERO function - Function can be used, when we are dividing by a column that may contain 0, \n",
|
|
1301
|
+
"# so that we can avoid errors coming from expressions such as:\n",
|
|
1302
|
+
"# 8 / 0\n",
|
|
1303
|
+
"# Note:\n",
|
|
1304
|
+
"# In this example, we have combined teradataml ColumnExpression and SQLAlchemy func object\n",
|
|
1305
|
+
"# admissions_train.gpa -- Is a teradataml ColumnExpression\n",
|
|
1306
|
+
"# func.nullifzero(admissions_train.admitted.expression) -- Is SQLAlchemy func object\n",
|
|
1307
|
+
"df = admissions_train.assign(admitted_null_if_zero = admissions_train.gpa / func.nullifzero(admissions_train.admitted.expression))\n",
|
|
1308
|
+
"print_variables(df, \"admitted_null_if_zero\")"
|
|
1309
|
+
]
|
|
1310
|
+
},
|
|
1311
|
+
{
|
|
1312
|
+
"cell_type": "markdown",
|
|
1313
|
+
"metadata": {},
|
|
1314
|
+
"source": [
|
|
1315
|
+
"### ZEROIFNULL Function"
|
|
1316
|
+
]
|
|
1317
|
+
},
|
|
1318
|
+
{
|
|
1319
|
+
"cell_type": "code",
|
|
1320
|
+
"execution_count": 38,
|
|
1321
|
+
"metadata": {},
|
|
1322
|
+
"outputs": [],
|
|
1323
|
+
"source": [
|
|
1324
|
+
"# Function converts data from null to 0 to avoid cases where a null result creates an error.\n",
|
|
1325
|
+
"# Syntax:\n",
|
|
1326
|
+
"# ZEROIFNULL(expr)\n",
|
|
1327
|
+
"# Where, \n",
|
|
1328
|
+
"# expr - can be column_expression or a constant"
|
|
1329
|
+
]
|
|
1330
|
+
},
|
|
1331
|
+
{
|
|
1332
|
+
"cell_type": "code",
|
|
1333
|
+
"execution_count": 39,
|
|
1334
|
+
"metadata": {},
|
|
1335
|
+
"outputs": [
|
|
1336
|
+
{
|
|
1337
|
+
"name": "stdout",
|
|
1338
|
+
"output_type": "stream",
|
|
1339
|
+
"text": [
|
|
1340
|
+
"Equivalent SQL: select id AS id, masters AS masters, gpa AS gpa, stats AS stats, programming AS programming, admitted AS admitted, gpa / nullifzero(admitted) AS admitted_null_if_zero, zeroifnull(gpa / nullifzero(admitted)) AS admitted_zero_if_null from \"admissions_train\"\n",
|
|
1341
|
+
"\n",
|
|
1342
|
+
"\n",
|
|
1343
|
+
" ************************* DataFrame ********************* \n",
|
|
1344
|
+
" masters gpa stats programming admitted admitted_null_if_zero admitted_zero_if_null\n",
|
|
1345
|
+
"id \n",
|
|
1346
|
+
"13 no 4.00 Advanced Novice 1 4.00 4.00000000000000E 000\n",
|
|
1347
|
+
"26 yes 3.57 Advanced Advanced 1 3.57 3.57000000000000E 000\n",
|
|
1348
|
+
"5 no 3.44 Novice Novice 0 NaN 0.00000000000000E 000\n",
|
|
1349
|
+
"19 yes 1.98 Advanced Advanced 0 NaN 0.00000000000000E 000\n",
|
|
1350
|
+
"15 yes 4.00 Advanced Advanced 1 4.00 4.00000000000000E 000\n",
|
|
1351
|
+
"40 yes 3.95 Novice Beginner 0 NaN 0.00000000000000E 000\n",
|
|
1352
|
+
"7 yes 2.33 Novice Novice 1 2.33 2.33000000000000E 000\n",
|
|
1353
|
+
"22 yes 3.46 Novice Beginner 0 NaN 0.00000000000000E 000\n",
|
|
1354
|
+
"36 no 3.00 Advanced Novice 0 NaN 0.00000000000000E 000\n",
|
|
1355
|
+
"38 yes 2.65 Advanced Beginner 1 2.65 2.65000000000000E 000\n",
|
|
1356
|
+
"\n",
|
|
1357
|
+
"\n",
|
|
1358
|
+
"\n",
|
|
1359
|
+
" ************************* DataFrame.dtypes ********************* \n",
|
|
1360
|
+
"id int\n",
|
|
1361
|
+
"masters str\n",
|
|
1362
|
+
"gpa float\n",
|
|
1363
|
+
"stats str\n",
|
|
1364
|
+
"programming str\n",
|
|
1365
|
+
"admitted int\n",
|
|
1366
|
+
"admitted_null_if_zero float\n",
|
|
1367
|
+
"admitted_zero_if_null str\n",
|
|
1368
|
+
"\n",
|
|
1369
|
+
"\n",
|
|
1370
|
+
"\n",
|
|
1371
|
+
" 'admitted_null_if_zero' Column Type: FLOAT\n",
|
|
1372
|
+
" 'admitted_zero_if_null' Column Type: NullType\n"
|
|
1373
|
+
]
|
|
1374
|
+
}
|
|
1375
|
+
],
|
|
1376
|
+
"source": [
|
|
1377
|
+
"# Note:\n",
|
|
1378
|
+
"# In this example, we have combined teradataml ColumnExpression and SQLAlchemy func object\n",
|
|
1379
|
+
"# admissions_train.gpa -- Is a teradataml ColumnExpression\n",
|
|
1380
|
+
"# func.nullifzero(admissions_train.admitted.expression) -- Is SQLAlchemy func object\n",
|
|
1381
|
+
"df = admissions_train.assign(admitted_null_if_zero = admissions_train.gpa / func.nullifzero(admissions_train.admitted.expression),\n",
|
|
1382
|
+
" admitted_zero_if_null = func.zeroifnull(\n",
|
|
1383
|
+
" admissions_train.gpa.expression / func.nullifzero(admissions_train.admitted.expression)))\n",
|
|
1384
|
+
"print_variables(df, [\"admitted_null_if_zero\", \"admitted_zero_if_null\"])"
|
|
1385
|
+
]
|
|
1386
|
+
},
|
|
1387
|
+
{
|
|
1388
|
+
"cell_type": "markdown",
|
|
1389
|
+
"metadata": {},
|
|
1390
|
+
"source": [
|
|
1391
|
+
"### POWER function"
|
|
1392
|
+
]
|
|
1393
|
+
},
|
|
1394
|
+
{
|
|
1395
|
+
"cell_type": "code",
|
|
1396
|
+
"execution_count": 40,
|
|
1397
|
+
"metadata": {},
|
|
1398
|
+
"outputs": [],
|
|
1399
|
+
"source": [
|
|
1400
|
+
"# Function returns base_value raised to the power of exponent_value.\n",
|
|
1401
|
+
"# Syntax:\n",
|
|
1402
|
+
"# power(expr1, expr2)\n",
|
|
1403
|
+
"# Where, \n",
|
|
1404
|
+
"# expr1 and expr2 can be column_expression or a constant"
|
|
1405
|
+
]
|
|
1406
|
+
},
|
|
1407
|
+
{
|
|
1408
|
+
"cell_type": "code",
|
|
1409
|
+
"execution_count": 41,
|
|
1410
|
+
"metadata": {},
|
|
1411
|
+
"outputs": [
|
|
1412
|
+
{
|
|
1413
|
+
"name": "stdout",
|
|
1414
|
+
"output_type": "stream",
|
|
1415
|
+
"text": [
|
|
1416
|
+
"Equivalent SQL: select id AS id, masters AS masters, gpa AS gpa, stats AS stats, programming AS programming, admitted AS admitted, power(gpa, 2) AS pow2gpa, power(gpa, admitted) AS pow_admitted_gpa from \"admissions_train\"\n",
|
|
1417
|
+
"\n",
|
|
1418
|
+
"\n",
|
|
1419
|
+
" ************************* DataFrame ********************* \n",
|
|
1420
|
+
" masters gpa stats programming admitted pow2gpa pow_admitted_gpa\n",
|
|
1421
|
+
"id \n",
|
|
1422
|
+
"13 no 4.00 Advanced Novice 1 16.0000 4.00\n",
|
|
1423
|
+
"26 yes 3.57 Advanced Advanced 1 12.7449 3.57\n",
|
|
1424
|
+
"5 no 3.44 Novice Novice 0 11.8336 1.00\n",
|
|
1425
|
+
"19 yes 1.98 Advanced Advanced 0 3.9204 1.00\n",
|
|
1426
|
+
"15 yes 4.00 Advanced Advanced 1 16.0000 4.00\n",
|
|
1427
|
+
"40 yes 3.95 Novice Beginner 0 15.6025 1.00\n",
|
|
1428
|
+
"7 yes 2.33 Novice Novice 1 5.4289 2.33\n",
|
|
1429
|
+
"22 yes 3.46 Novice Beginner 0 11.9716 1.00\n",
|
|
1430
|
+
"36 no 3.00 Advanced Novice 0 9.0000 1.00\n",
|
|
1431
|
+
"38 yes 2.65 Advanced Beginner 1 7.0225 2.65\n",
|
|
1432
|
+
"\n",
|
|
1433
|
+
"\n",
|
|
1434
|
+
"\n",
|
|
1435
|
+
" ************************* DataFrame.dtypes ********************* \n",
|
|
1436
|
+
"id int\n",
|
|
1437
|
+
"masters str\n",
|
|
1438
|
+
"gpa float\n",
|
|
1439
|
+
"stats str\n",
|
|
1440
|
+
"programming str\n",
|
|
1441
|
+
"admitted int\n",
|
|
1442
|
+
"pow2gpa float\n",
|
|
1443
|
+
"pow_admitted_gpa float\n",
|
|
1444
|
+
"\n",
|
|
1445
|
+
"\n",
|
|
1446
|
+
"\n",
|
|
1447
|
+
" 'pow2gpa' Column Type: FLOAT\n",
|
|
1448
|
+
" 'pow_admitted_gpa' Column Type: FLOAT\n"
|
|
1449
|
+
]
|
|
1450
|
+
}
|
|
1451
|
+
],
|
|
1452
|
+
"source": [
|
|
1453
|
+
"# Use case POWER function:\n",
|
|
1454
|
+
"# Find square of values in gpa column and gpa as base value raised to the value in admitted.\n",
|
|
1455
|
+
"df = admissions_train.assign(pow2gpa = func.power(admissions_train.gpa.expression, 2),\n",
|
|
1456
|
+
" pow_admitted_gpa = func.power(admissions_train.gpa.expression, admissions_train.admitted.expression))\n",
|
|
1457
|
+
"print_variables(df, [\"pow2gpa\", \"pow_admitted_gpa\"])"
|
|
1458
|
+
]
|
|
1459
|
+
},
|
|
1460
|
+
{
|
|
1461
|
+
"cell_type": "markdown",
|
|
1462
|
+
"metadata": {},
|
|
1463
|
+
"source": [
|
|
1464
|
+
"### Round Functions"
|
|
1465
|
+
]
|
|
1466
|
+
},
|
|
1467
|
+
{
|
|
1468
|
+
"cell_type": "code",
|
|
1469
|
+
"execution_count": 42,
|
|
1470
|
+
"metadata": {},
|
|
1471
|
+
"outputs": [],
|
|
1472
|
+
"source": [
|
|
1473
|
+
"# Function returns numeric_value rounded places_value places to the right or left of the decimal point.\n",
|
|
1474
|
+
"# Syntax:\n",
|
|
1475
|
+
"# ROUND(expr1, expr2)\n",
|
|
1476
|
+
"# Where, \n",
|
|
1477
|
+
"# expr1 and expr2 can be column_expression or a constant"
|
|
1478
|
+
]
|
|
1479
|
+
},
|
|
1480
|
+
{
|
|
1481
|
+
"cell_type": "code",
|
|
1482
|
+
"execution_count": 43,
|
|
1483
|
+
"metadata": {},
|
|
1484
|
+
"outputs": [
|
|
1485
|
+
{
|
|
1486
|
+
"name": "stdout",
|
|
1487
|
+
"output_type": "stream",
|
|
1488
|
+
"text": [
|
|
1489
|
+
"Equivalent SQL: select id AS id, masters AS masters, gpa AS gpa, stats AS stats, programming AS programming, admitted AS admitted, ROUND(2.433412, 3) AS round_const_3, Round(gpa, 1) AS round_gpa_1, round(gpa, admitted) AS round_gpa_admitted from \"admissions_train\"\n",
|
|
1490
|
+
"\n",
|
|
1491
|
+
"\n",
|
|
1492
|
+
" ************************* DataFrame ********************* \n",
|
|
1493
|
+
" masters gpa stats programming admitted round_const_3 round_gpa_1 round_gpa_admitted\n",
|
|
1494
|
+
"id \n",
|
|
1495
|
+
"5 no 3.44 Novice Novice 0 2.433 3.4 3.0\n",
|
|
1496
|
+
"34 yes 3.85 Advanced Beginner 0 2.433 3.9 4.0\n",
|
|
1497
|
+
"13 no 4.00 Advanced Novice 1 2.433 4.0 4.0\n",
|
|
1498
|
+
"40 yes 3.95 Novice Beginner 0 2.433 4.0 4.0\n",
|
|
1499
|
+
"22 yes 3.46 Novice Beginner 0 2.433 3.5 3.0\n",
|
|
1500
|
+
"19 yes 1.98 Advanced Advanced 0 2.433 2.0 2.0\n",
|
|
1501
|
+
"36 no 3.00 Advanced Novice 0 2.433 3.0 3.0\n",
|
|
1502
|
+
"15 yes 4.00 Advanced Advanced 1 2.433 4.0 4.0\n",
|
|
1503
|
+
"7 yes 2.33 Novice Novice 1 2.433 2.3 2.3\n",
|
|
1504
|
+
"17 no 3.83 Advanced Advanced 1 2.433 3.8 3.8\n",
|
|
1505
|
+
"\n",
|
|
1506
|
+
"\n",
|
|
1507
|
+
"\n",
|
|
1508
|
+
" ************************* DataFrame.dtypes ********************* \n",
|
|
1509
|
+
"id int\n",
|
|
1510
|
+
"masters str\n",
|
|
1511
|
+
"gpa float\n",
|
|
1512
|
+
"stats str\n",
|
|
1513
|
+
"programming str\n",
|
|
1514
|
+
"admitted int\n",
|
|
1515
|
+
"round_const_3 float\n",
|
|
1516
|
+
"round_gpa_1 float\n",
|
|
1517
|
+
"round_gpa_admitted float\n",
|
|
1518
|
+
"\n",
|
|
1519
|
+
"\n",
|
|
1520
|
+
"\n",
|
|
1521
|
+
" 'round_gpa_1' Column Type: FLOAT\n",
|
|
1522
|
+
" 'round_gpa_admitted' Column Type: FLOAT\n",
|
|
1523
|
+
" 'round_const_3' Column Type: FLOAT\n"
|
|
1524
|
+
]
|
|
1525
|
+
}
|
|
1526
|
+
],
|
|
1527
|
+
"source": [
|
|
1528
|
+
"# Example use cases for Round\n",
|
|
1529
|
+
"df = admissions_train.assign(round_gpa_1 = func.Round(admissions_train.gpa.expression, 1),\n",
|
|
1530
|
+
" round_gpa_admitted = func.round(admissions_train.gpa.expression, admissions_train.admitted.expression),\n",
|
|
1531
|
+
" round_const_3 = func.ROUND(2.433412, 3))\n",
|
|
1532
|
+
"print_variables(df, [\"round_gpa_1\", \"round_gpa_admitted\", \"round_const_3\"])"
|
|
1533
|
+
]
|
|
1534
|
+
},
|
|
1535
|
+
{
|
|
1536
|
+
"cell_type": "markdown",
|
|
1537
|
+
"metadata": {},
|
|
1538
|
+
"source": [
|
|
1539
|
+
"### SIGN Function"
|
|
1540
|
+
]
|
|
1541
|
+
},
|
|
1542
|
+
{
|
|
1543
|
+
"cell_type": "code",
|
|
1544
|
+
"execution_count": 44,
|
|
1545
|
+
"metadata": {},
|
|
1546
|
+
"outputs": [],
|
|
1547
|
+
"source": [
|
|
1548
|
+
"# Returns the sign of numeric_value.\n",
|
|
1549
|
+
"# Syntax:\n",
|
|
1550
|
+
"# sign(expr)\n",
|
|
1551
|
+
"# Where, \n",
|
|
1552
|
+
"# expr can be column_expression or a constant"
|
|
1553
|
+
]
|
|
1554
|
+
},
|
|
1555
|
+
{
|
|
1556
|
+
"cell_type": "code",
|
|
1557
|
+
"execution_count": 45,
|
|
1558
|
+
"metadata": {},
|
|
1559
|
+
"outputs": [
|
|
1560
|
+
{
|
|
1561
|
+
"name": "stdout",
|
|
1562
|
+
"output_type": "stream",
|
|
1563
|
+
"text": [
|
|
1564
|
+
"Equivalent SQL: select id AS id, masters AS masters, gpa AS gpa, stats AS stats, programming AS programming, admitted AS admitted, sign(-3) AS sign_const, sign(gpa) AS sign_gpa from \"admissions_train\"\n",
|
|
1565
|
+
"\n",
|
|
1566
|
+
"\n",
|
|
1567
|
+
" ************************* DataFrame ********************* \n",
|
|
1568
|
+
" masters gpa stats programming admitted sign_const sign_gpa\n",
|
|
1569
|
+
"id \n",
|
|
1570
|
+
"22 yes 3.46 Novice Beginner 0 -1 1\n",
|
|
1571
|
+
"26 yes 3.57 Advanced Advanced 1 -1 1\n",
|
|
1572
|
+
"5 no 3.44 Novice Novice 0 -1 1\n",
|
|
1573
|
+
"17 no 3.83 Advanced Advanced 1 -1 1\n",
|
|
1574
|
+
"13 no 4.00 Advanced Novice 1 -1 1\n",
|
|
1575
|
+
"19 yes 1.98 Advanced Advanced 0 -1 1\n",
|
|
1576
|
+
"36 no 3.00 Advanced Novice 0 -1 1\n",
|
|
1577
|
+
"15 yes 4.00 Advanced Advanced 1 -1 1\n",
|
|
1578
|
+
"34 yes 3.85 Advanced Beginner 0 -1 1\n",
|
|
1579
|
+
"38 yes 2.65 Advanced Beginner 1 -1 1\n",
|
|
1580
|
+
"\n",
|
|
1581
|
+
"\n",
|
|
1582
|
+
"\n",
|
|
1583
|
+
" ************************* DataFrame.dtypes ********************* \n",
|
|
1584
|
+
"id int\n",
|
|
1585
|
+
"masters str\n",
|
|
1586
|
+
"gpa float\n",
|
|
1587
|
+
"stats str\n",
|
|
1588
|
+
"programming str\n",
|
|
1589
|
+
"admitted int\n",
|
|
1590
|
+
"sign_const decimal.Decimal\n",
|
|
1591
|
+
"sign_gpa decimal.Decimal\n",
|
|
1592
|
+
"\n",
|
|
1593
|
+
"\n",
|
|
1594
|
+
"\n",
|
|
1595
|
+
" 'sign_gpa' Column Type: NUMBER\n",
|
|
1596
|
+
" 'sign_const' Column Type: NUMBER\n"
|
|
1597
|
+
]
|
|
1598
|
+
}
|
|
1599
|
+
],
|
|
1600
|
+
"source": [
|
|
1601
|
+
"# SIGN function\n",
|
|
1602
|
+
"df = admissions_train.assign(sign_gpa = func.sign(admissions_train.gpa.expression),\n",
|
|
1603
|
+
" sign_const = func.sign(-3))\n",
|
|
1604
|
+
"print_variables(df, [\"sign_gpa\", \"sign_const\"])"
|
|
1605
|
+
]
|
|
1606
|
+
},
|
|
1607
|
+
{
|
|
1608
|
+
"cell_type": "markdown",
|
|
1609
|
+
"metadata": {},
|
|
1610
|
+
"source": [
|
|
1611
|
+
"### SQRT Function"
|
|
1612
|
+
]
|
|
1613
|
+
},
|
|
1614
|
+
{
|
|
1615
|
+
"cell_type": "code",
|
|
1616
|
+
"execution_count": 46,
|
|
1617
|
+
"metadata": {},
|
|
1618
|
+
"outputs": [],
|
|
1619
|
+
"source": [
|
|
1620
|
+
"# Computes the square root of an argument.\n",
|
|
1621
|
+
"# Syntax:\n",
|
|
1622
|
+
"# sqrt(expr)\n",
|
|
1623
|
+
"# Where, \n",
|
|
1624
|
+
"# expr can be column_expression or a constant"
|
|
1625
|
+
]
|
|
1626
|
+
},
|
|
1627
|
+
{
|
|
1628
|
+
"cell_type": "code",
|
|
1629
|
+
"execution_count": 47,
|
|
1630
|
+
"metadata": {},
|
|
1631
|
+
"outputs": [
|
|
1632
|
+
{
|
|
1633
|
+
"name": "stdout",
|
|
1634
|
+
"output_type": "stream",
|
|
1635
|
+
"text": [
|
|
1636
|
+
"Equivalent SQL: select id AS id, masters AS masters, gpa AS gpa, stats AS stats, programming AS programming, admitted AS admitted, SQRT(25) AS sqrt_const, sqrt(gpa) AS sqrt_gpa from \"admissions_train\"\n",
|
|
1637
|
+
"\n",
|
|
1638
|
+
"\n",
|
|
1639
|
+
" ************************* DataFrame ********************* \n",
|
|
1640
|
+
" masters gpa stats programming admitted sqrt_const sqrt_gpa\n",
|
|
1641
|
+
"id \n",
|
|
1642
|
+
"5 no 3.44 Novice Novice 0 5.0 1.854724\n",
|
|
1643
|
+
"34 yes 3.85 Advanced Beginner 0 5.0 1.962142\n",
|
|
1644
|
+
"13 no 4.00 Advanced Novice 1 5.0 2.000000\n",
|
|
1645
|
+
"40 yes 3.95 Novice Beginner 0 5.0 1.987461\n",
|
|
1646
|
+
"22 yes 3.46 Novice Beginner 0 5.0 1.860108\n",
|
|
1647
|
+
"19 yes 1.98 Advanced Advanced 0 5.0 1.407125\n",
|
|
1648
|
+
"36 no 3.00 Advanced Novice 0 5.0 1.732051\n",
|
|
1649
|
+
"15 yes 4.00 Advanced Advanced 1 5.0 2.000000\n",
|
|
1650
|
+
"7 yes 2.33 Novice Novice 1 5.0 1.526434\n",
|
|
1651
|
+
"17 no 3.83 Advanced Advanced 1 5.0 1.957039\n",
|
|
1652
|
+
"\n",
|
|
1653
|
+
"\n",
|
|
1654
|
+
"\n",
|
|
1655
|
+
" ************************* DataFrame.dtypes ********************* \n",
|
|
1656
|
+
"id int\n",
|
|
1657
|
+
"masters str\n",
|
|
1658
|
+
"gpa float\n",
|
|
1659
|
+
"stats str\n",
|
|
1660
|
+
"programming str\n",
|
|
1661
|
+
"admitted int\n",
|
|
1662
|
+
"sqrt_const float\n",
|
|
1663
|
+
"sqrt_gpa float\n",
|
|
1664
|
+
"\n",
|
|
1665
|
+
"\n",
|
|
1666
|
+
"\n",
|
|
1667
|
+
" 'sqrt_gpa' Column Type: FLOAT\n",
|
|
1668
|
+
" 'sqrt_const' Column Type: FLOAT\n"
|
|
1669
|
+
]
|
|
1670
|
+
}
|
|
1671
|
+
],
|
|
1672
|
+
"source": [
|
|
1673
|
+
"# Use case for sqrt function\n",
|
|
1674
|
+
"df = admissions_train.assign(sqrt_gpa = func.sqrt(admissions_train.gpa.expression),\n",
|
|
1675
|
+
" sqrt_const = func.SQRT(25))\n",
|
|
1676
|
+
"print_variables(df, [\"sqrt_gpa\", \"sqrt_const\"])"
|
|
1677
|
+
]
|
|
1678
|
+
},
|
|
1679
|
+
{
|
|
1680
|
+
"cell_type": "markdown",
|
|
1681
|
+
"metadata": {},
|
|
1682
|
+
"source": [
|
|
1683
|
+
"## Trignometric Functions"
|
|
1684
|
+
]
|
|
1685
|
+
},
|
|
1686
|
+
{
|
|
1687
|
+
"cell_type": "code",
|
|
1688
|
+
"execution_count": 48,
|
|
1689
|
+
"metadata": {},
|
|
1690
|
+
"outputs": [],
|
|
1691
|
+
"source": [
|
|
1692
|
+
"# These functions perform the trigonometric or inverse trigonometric function of an argument.\n",
|
|
1693
|
+
"# Following hyperbolic function are available:\n",
|
|
1694
|
+
"# - COS(expr)\n",
|
|
1695
|
+
"# - SIN(expr)\n",
|
|
1696
|
+
"# - TAN(expr)\n",
|
|
1697
|
+
"# - ACOS(expr)\n",
|
|
1698
|
+
"# - ASIN(expr)\n",
|
|
1699
|
+
"# - ATAN(expr)\n",
|
|
1700
|
+
"# - ATAN2(x,y)\n",
|
|
1701
|
+
"# Where, \n",
|
|
1702
|
+
"# expr can be column_expression or a constant\n",
|
|
1703
|
+
"# x - The x-coordinate of a point to use in the arctangent calculation.\n",
|
|
1704
|
+
"# y - The y-coordinate of a point to use in the arctangent calculation."
|
|
1705
|
+
]
|
|
1706
|
+
},
|
|
1707
|
+
{
|
|
1708
|
+
"cell_type": "code",
|
|
1709
|
+
"execution_count": 49,
|
|
1710
|
+
"metadata": {
|
|
1711
|
+
"scrolled": true
|
|
1712
|
+
},
|
|
1713
|
+
"outputs": [
|
|
1714
|
+
{
|
|
1715
|
+
"name": "stdout",
|
|
1716
|
+
"output_type": "stream",
|
|
1717
|
+
"text": [
|
|
1718
|
+
"Equivalent SQL: select id AS id, masters AS masters, gpa AS gpa, stats AS stats, programming AS programming, admitted AS admitted, acos(admitted) AS acos_admitted, asin(admitted) AS asin_admitted, atan2(1, 1) AS atan2_admitted, atan(admitted) AS atan_admitted, cos(admitted) AS cos_admitted, sin(admitted) AS sin_admitted, tan(admitted) AS tan_admitted from \"admissions_train\"\n",
|
|
1719
|
+
"\n",
|
|
1720
|
+
"\n",
|
|
1721
|
+
" ************************* DataFrame ********************* \n",
|
|
1722
|
+
" masters gpa stats programming admitted acos_admitted asin_admitted atan2_admitted atan_admitted cos_admitted sin_admitted tan_admitted\n",
|
|
1723
|
+
"id \n",
|
|
1724
|
+
"22 yes 3.46 Novice Beginner 0 1.570796 0.000000 0.785398 0.000000 1.000000 0.000000 0.000000\n",
|
|
1725
|
+
"36 no 3.00 Advanced Novice 0 1.570796 0.000000 0.785398 0.000000 1.000000 0.000000 0.000000\n",
|
|
1726
|
+
"15 yes 4.00 Advanced Advanced 1 0.000000 1.570796 0.785398 0.785398 0.540302 0.841471 1.557408\n",
|
|
1727
|
+
"38 yes 2.65 Advanced Beginner 1 0.000000 1.570796 0.785398 0.785398 0.540302 0.841471 1.557408\n",
|
|
1728
|
+
"5 no 3.44 Novice Novice 0 1.570796 0.000000 0.785398 0.000000 1.000000 0.000000 0.000000\n",
|
|
1729
|
+
"17 no 3.83 Advanced Advanced 1 0.000000 1.570796 0.785398 0.785398 0.540302 0.841471 1.557408\n",
|
|
1730
|
+
"34 yes 3.85 Advanced Beginner 0 1.570796 0.000000 0.785398 0.000000 1.000000 0.000000 0.000000\n",
|
|
1731
|
+
"13 no 4.00 Advanced Novice 1 0.000000 1.570796 0.785398 0.785398 0.540302 0.841471 1.557408\n",
|
|
1732
|
+
"26 yes 3.57 Advanced Advanced 1 0.000000 1.570796 0.785398 0.785398 0.540302 0.841471 1.557408\n",
|
|
1733
|
+
"19 yes 1.98 Advanced Advanced 0 1.570796 0.000000 0.785398 0.000000 1.000000 0.000000 0.000000\n",
|
|
1734
|
+
"\n",
|
|
1735
|
+
"\n",
|
|
1736
|
+
"\n",
|
|
1737
|
+
" ************************* DataFrame.dtypes ********************* \n",
|
|
1738
|
+
"id int\n",
|
|
1739
|
+
"masters str\n",
|
|
1740
|
+
"gpa float\n",
|
|
1741
|
+
"stats str\n",
|
|
1742
|
+
"programming str\n",
|
|
1743
|
+
"admitted int\n",
|
|
1744
|
+
"acos_admitted float\n",
|
|
1745
|
+
"asin_admitted float\n",
|
|
1746
|
+
"atan2_admitted float\n",
|
|
1747
|
+
"atan_admitted float\n",
|
|
1748
|
+
"cos_admitted float\n",
|
|
1749
|
+
"sin_admitted float\n",
|
|
1750
|
+
"tan_admitted float\n",
|
|
1751
|
+
"\n",
|
|
1752
|
+
"\n",
|
|
1753
|
+
"\n",
|
|
1754
|
+
" 'cos_admitted' Column Type: FLOAT\n",
|
|
1755
|
+
" 'sin_admitted' Column Type: FLOAT\n",
|
|
1756
|
+
" 'acos_admitted' Column Type: FLOAT\n",
|
|
1757
|
+
" 'asin_admitted' Column Type: FLOAT\n",
|
|
1758
|
+
" 'tan_admitted' Column Type: FLOAT\n",
|
|
1759
|
+
" 'atan_admitted' Column Type: FLOAT\n",
|
|
1760
|
+
" 'atan2_admitted' Column Type: FLOAT\n"
|
|
1761
|
+
]
|
|
1762
|
+
}
|
|
1763
|
+
],
|
|
1764
|
+
"source": [
|
|
1765
|
+
"# Use case for trignometric function\n",
|
|
1766
|
+
"df = admissions_train.assign(cos_admitted = func.cos(admissions_train.admitted.expression),\n",
|
|
1767
|
+
" sin_admitted = func.sin(admissions_train.admitted.expression),\n",
|
|
1768
|
+
" acos_admitted = func.acos(admissions_train.admitted.expression),\n",
|
|
1769
|
+
" asin_admitted = func.asin(admissions_train.admitted.expression),\n",
|
|
1770
|
+
" tan_admitted = func.tan(admissions_train.admitted.expression),\n",
|
|
1771
|
+
" atan_admitted = func.atan(admissions_train.admitted.expression),\n",
|
|
1772
|
+
" atan2_admitted = func.atan2(1,1))\n",
|
|
1773
|
+
"print_variables(df, [\"cos_admitted\", \"sin_admitted\", \"acos_admitted\", \"asin_admitted\", \"tan_admitted\", \"atan_admitted\", \"atan2_admitted\"])"
|
|
1774
|
+
]
|
|
1775
|
+
},
|
|
1776
|
+
{
|
|
1777
|
+
"cell_type": "markdown",
|
|
1778
|
+
"metadata": {},
|
|
1779
|
+
"source": [
|
|
1780
|
+
"### TRUNC Function"
|
|
1781
|
+
]
|
|
1782
|
+
},
|
|
1783
|
+
{
|
|
1784
|
+
"cell_type": "code",
|
|
1785
|
+
"execution_count": 50,
|
|
1786
|
+
"metadata": {},
|
|
1787
|
+
"outputs": [],
|
|
1788
|
+
"source": [
|
|
1789
|
+
"# Returns expr1 truncated expr2 places to the right or left of the decimal point.\n",
|
|
1790
|
+
"# Syntax:\n",
|
|
1791
|
+
"# TRUNC(expr1, expr2)\n",
|
|
1792
|
+
"# Where, \n",
|
|
1793
|
+
"# expr1 and expr2 can be column_expression or a constant"
|
|
1794
|
+
]
|
|
1795
|
+
},
|
|
1796
|
+
{
|
|
1797
|
+
"cell_type": "code",
|
|
1798
|
+
"execution_count": 51,
|
|
1799
|
+
"metadata": {},
|
|
1800
|
+
"outputs": [
|
|
1801
|
+
{
|
|
1802
|
+
"name": "stdout",
|
|
1803
|
+
"output_type": "stream",
|
|
1804
|
+
"text": [
|
|
1805
|
+
"Equivalent SQL: select id AS id, masters AS masters, gpa AS gpa, stats AS stats, programming AS programming, admitted AS admitted, Trunc(2.433412, -3) AS trunc_const_3, TRUNC(gpa, 1) AS trunc_gpa_1, trunc(gpa, admitted) AS trunc_gpa_admitted from \"admissions_train\"\n",
|
|
1806
|
+
"\n",
|
|
1807
|
+
"\n",
|
|
1808
|
+
" ************************* DataFrame ********************* \n",
|
|
1809
|
+
" masters gpa stats programming admitted trunc_const_3 trunc_gpa_1 trunc_gpa_admitted\n",
|
|
1810
|
+
"id \n",
|
|
1811
|
+
"5 no 3.44 Novice Novice 0 0.0 3.4 3.0\n",
|
|
1812
|
+
"7 yes 2.33 Novice Novice 1 0.0 2.3 2.3\n",
|
|
1813
|
+
"22 yes 3.46 Novice Beginner 0 0.0 3.4 3.0\n",
|
|
1814
|
+
"19 yes 1.98 Advanced Advanced 0 0.0 1.9 1.0\n",
|
|
1815
|
+
"15 yes 4.00 Advanced Advanced 1 0.0 4.0 4.0\n",
|
|
1816
|
+
"17 no 3.83 Advanced Advanced 1 0.0 3.8 3.8\n",
|
|
1817
|
+
"34 yes 3.85 Advanced Beginner 0 0.0 3.8 3.0\n",
|
|
1818
|
+
"13 no 4.00 Advanced Novice 1 0.0 4.0 4.0\n",
|
|
1819
|
+
"36 no 3.00 Advanced Novice 0 0.0 3.0 3.0\n",
|
|
1820
|
+
"40 yes 3.95 Novice Beginner 0 0.0 3.9 3.0\n",
|
|
1821
|
+
"\n",
|
|
1822
|
+
"\n",
|
|
1823
|
+
"\n",
|
|
1824
|
+
" ************************* DataFrame.dtypes ********************* \n",
|
|
1825
|
+
"id int\n",
|
|
1826
|
+
"masters str\n",
|
|
1827
|
+
"gpa float\n",
|
|
1828
|
+
"stats str\n",
|
|
1829
|
+
"programming str\n",
|
|
1830
|
+
"admitted int\n",
|
|
1831
|
+
"trunc_const_3 float\n",
|
|
1832
|
+
"trunc_gpa_1 float\n",
|
|
1833
|
+
"trunc_gpa_admitted float\n",
|
|
1834
|
+
"\n",
|
|
1835
|
+
"\n",
|
|
1836
|
+
"\n",
|
|
1837
|
+
" 'trunc_gpa_1' Column Type: FLOAT\n",
|
|
1838
|
+
" 'trunc_gpa_admitted' Column Type: FLOAT\n",
|
|
1839
|
+
" 'trunc_const_3' Column Type: FLOAT\n"
|
|
1840
|
+
]
|
|
1841
|
+
}
|
|
1842
|
+
],
|
|
1843
|
+
"source": [
|
|
1844
|
+
"# Example use cases for TRUNC\n",
|
|
1845
|
+
"df = admissions_train.assign(trunc_gpa_1 = func.TRUNC(admissions_train.gpa.expression, 1),\n",
|
|
1846
|
+
" trunc_gpa_admitted = func.trunc(admissions_train.gpa.expression, admissions_train.admitted.expression),\n",
|
|
1847
|
+
" trunc_const_3 = func.Trunc(2.433412, -3))\n",
|
|
1848
|
+
"print_variables(df, [\"trunc_gpa_1\", \"trunc_gpa_admitted\", \"trunc_const_3\"])"
|
|
1849
|
+
]
|
|
1850
|
+
},
|
|
1851
|
+
{
|
|
1852
|
+
"cell_type": "markdown",
|
|
1853
|
+
"metadata": {},
|
|
1854
|
+
"source": [
|
|
1855
|
+
"### WIDTH_BUCKET Function"
|
|
1856
|
+
]
|
|
1857
|
+
},
|
|
1858
|
+
{
|
|
1859
|
+
"cell_type": "code",
|
|
1860
|
+
"execution_count": 52,
|
|
1861
|
+
"metadata": {},
|
|
1862
|
+
"outputs": [],
|
|
1863
|
+
"source": [
|
|
1864
|
+
"# Function returns the number of the partition to which value_expression is assigned.\n",
|
|
1865
|
+
"# Syntax:\n",
|
|
1866
|
+
"# width_bucket(value_expression, lower_bound, upper_bound, partition_count)\n",
|
|
1867
|
+
"# Where,\n",
|
|
1868
|
+
"# value_expression - Column for which a partition number is to be returned.\n",
|
|
1869
|
+
"# lower_bound - The lower boundary for the range of values to be partitioned equally.\n",
|
|
1870
|
+
"# upper_bound - The upper boundary for the range of values to be partitioned equally.\n",
|
|
1871
|
+
"# partition_count - Number of partitions to be created. \n",
|
|
1872
|
+
"# This value also specifies the width of the partitions by default.\n",
|
|
1873
|
+
"# The number of partitions created is partition_count + 2. \n",
|
|
1874
|
+
"# Partition 0 and partition partition_count + 1 account for values of \n",
|
|
1875
|
+
"# value_expression that are outside the lower and upper boundaries."
|
|
1876
|
+
]
|
|
1877
|
+
},
|
|
1878
|
+
{
|
|
1879
|
+
"cell_type": "code",
|
|
1880
|
+
"execution_count": 53,
|
|
1881
|
+
"metadata": {},
|
|
1882
|
+
"outputs": [
|
|
1883
|
+
{
|
|
1884
|
+
"name": "stdout",
|
|
1885
|
+
"output_type": "stream",
|
|
1886
|
+
"text": [
|
|
1887
|
+
"Equivalent SQL: select id AS id, masters AS masters, gpa AS gpa, stats AS stats, programming AS programming, admitted AS admitted, Width_bucket(gpa, 2.5, 3.5, 3) AS bucket_gpa_ from \"admissions_train\"\n",
|
|
1888
|
+
"\n",
|
|
1889
|
+
"\n",
|
|
1890
|
+
" ************************* DataFrame ********************* \n",
|
|
1891
|
+
" masters gpa stats programming admitted bucket_gpa_\n",
|
|
1892
|
+
"id \n",
|
|
1893
|
+
"15 yes 4.00 Advanced Advanced 1 4\n",
|
|
1894
|
+
"7 yes 2.33 Novice Novice 1 0\n",
|
|
1895
|
+
"22 yes 3.46 Novice Beginner 0 3\n",
|
|
1896
|
+
"17 no 3.83 Advanced Advanced 1 4\n",
|
|
1897
|
+
"13 no 4.00 Advanced Novice 1 4\n",
|
|
1898
|
+
"38 yes 2.65 Advanced Beginner 1 1\n",
|
|
1899
|
+
"26 yes 3.57 Advanced Advanced 1 4\n",
|
|
1900
|
+
"5 no 3.44 Novice Novice 0 3\n",
|
|
1901
|
+
"34 yes 3.85 Advanced Beginner 0 4\n",
|
|
1902
|
+
"40 yes 3.95 Novice Beginner 0 4\n",
|
|
1903
|
+
"\n",
|
|
1904
|
+
"\n",
|
|
1905
|
+
"\n",
|
|
1906
|
+
" ************************* DataFrame.dtypes ********************* \n",
|
|
1907
|
+
"id int\n",
|
|
1908
|
+
"masters str\n",
|
|
1909
|
+
"gpa float\n",
|
|
1910
|
+
"stats str\n",
|
|
1911
|
+
"programming str\n",
|
|
1912
|
+
"admitted int\n",
|
|
1913
|
+
"bucket_gpa_ int\n",
|
|
1914
|
+
"\n",
|
|
1915
|
+
"\n",
|
|
1916
|
+
"\n",
|
|
1917
|
+
" 'bucket_gpa_' Column Type: INTEGER\n"
|
|
1918
|
+
]
|
|
1919
|
+
}
|
|
1920
|
+
],
|
|
1921
|
+
"source": [
|
|
1922
|
+
"# Example use case for width_bucket\n",
|
|
1923
|
+
"df = admissions_train.assign(bucket_gpa_ = func.Width_bucket(admissions_train.gpa.expression, 2.5, 3.5, 3))\n",
|
|
1924
|
+
"print_variables(df, \"bucket_gpa_\")"
|
|
1925
|
+
]
|
|
1926
|
+
},
|
|
1927
|
+
{
|
|
1928
|
+
"cell_type": "code",
|
|
1929
|
+
"execution_count": 54,
|
|
1930
|
+
"metadata": {},
|
|
1931
|
+
"outputs": [],
|
|
1932
|
+
"source": [
|
|
1933
|
+
"# RANDOM, RANGE_N --> Need investigation"
|
|
1934
|
+
]
|
|
1935
|
+
},
|
|
1936
|
+
{
|
|
1937
|
+
"cell_type": "code",
|
|
1938
|
+
"execution_count": 55,
|
|
1939
|
+
"metadata": {},
|
|
1940
|
+
"outputs": [
|
|
1941
|
+
{
|
|
1942
|
+
"data": {
|
|
1943
|
+
"text/plain": [
|
|
1944
|
+
"True"
|
|
1945
|
+
]
|
|
1946
|
+
},
|
|
1947
|
+
"execution_count": 55,
|
|
1948
|
+
"metadata": {},
|
|
1949
|
+
"output_type": "execute_result"
|
|
1950
|
+
}
|
|
1951
|
+
],
|
|
1952
|
+
"source": [
|
|
1953
|
+
"# One must run remove_context() to close the connection and garbage collect internally generated objects.\n",
|
|
1954
|
+
"remove_context()"
|
|
1955
|
+
]
|
|
1956
|
+
},
|
|
1957
|
+
{
|
|
1958
|
+
"cell_type": "code",
|
|
1959
|
+
"execution_count": null,
|
|
1960
|
+
"metadata": {},
|
|
1961
|
+
"outputs": [],
|
|
1962
|
+
"source": []
|
|
1963
|
+
},
|
|
1964
|
+
{
|
|
1965
|
+
"cell_type": "code",
|
|
1966
|
+
"execution_count": null,
|
|
1967
|
+
"metadata": {},
|
|
1968
|
+
"outputs": [],
|
|
1969
|
+
"source": []
|
|
1970
|
+
}
|
|
1971
|
+
],
|
|
1972
|
+
"metadata": {
|
|
1973
|
+
"kernelspec": {
|
|
1974
|
+
"display_name": "Python 3",
|
|
1975
|
+
"language": "python",
|
|
1976
|
+
"name": "python3"
|
|
1977
|
+
},
|
|
1978
|
+
"language_info": {
|
|
1979
|
+
"codemirror_mode": {
|
|
1980
|
+
"name": "ipython",
|
|
1981
|
+
"version": 3
|
|
1982
|
+
},
|
|
1983
|
+
"file_extension": ".py",
|
|
1984
|
+
"mimetype": "text/x-python",
|
|
1985
|
+
"name": "python",
|
|
1986
|
+
"nbconvert_exporter": "python",
|
|
1987
|
+
"pygments_lexer": "ipython3",
|
|
1988
|
+
"version": "3.7.1"
|
|
1989
|
+
}
|
|
1990
|
+
},
|
|
1991
|
+
"nbformat": 4,
|
|
1992
|
+
"nbformat_minor": 2
|
|
1993
|
+
}
|