Last active
November 25, 2017 19:36
-
-
Save FavioVazquez/e0de2ecc3d21cc183cfedc28048d79bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import optimus | |
import optimus as op | |
# Instanciate DataFrameTransfomer | |
transformer = op.DataFrameTransformer(df) | |
# Get original dataFrame to show it. | |
transformer.show() | |
# Chaining function transformations | |
transformer.trim_col("*") | |
.remove_special_chars("*") | |
.clear_accents("*") | |
.lower_case("*") | |
.drop_col("dummyCol") | |
.date_transform("birth", "yyyyMMdd", "dd-MM-YYYY") | |
.age_calculate("birth", "dd-MM-YYYY", "clientAge") | |
.operation_in_type([('product', 'integer', None)]) | |
.lookup('product', str_to_replace='taco', list_str=['taaaccoo']) | |
.lookup('product', str_to_replace='pizza', list_str=['piza', 'pizzza']) | |
transformer.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment