Last active
August 14, 2021 10:26
-
-
Save thuwarakeshm/909ada186307a0f04faaeaa0eeff6a0c to your computer and use it in GitHub Desktop.
Analysis in a blink
This file contains hidden or 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
| @app.command() | |
| def compare_with_target(input1: str, input2: str, target: str): | |
| # Read CSVs from arguments | |
| df1, df2 = pd.read_csv(input1), pd.read_csv(input2) | |
| # Generate a comparison report against the target variable | |
| report = sv.compare(df1, df2, target) | |
| # Render HTML report in your default browser | |
| report.show_html() |
This file contains hidden or 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
| #! /usr/bin/python | |
| # If you are using a virtualenv you should change the above line to it's python executable. | |
| import pandas as pd | |
| from pandasgui import show | |
| import typer | |
| app = typer.Typer() | |
| @app.command() | |
| def report(filepath:str): | |
| df = pd.read_csv(filepath) | |
| show(df) | |
| if __name__ == "__main__": | |
| app() |
This file contains hidden or 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
| # -------------------- MORE FEATURES HERE, LATER ----------------- | |
| @app.command() | |
| def compare(input1: str, input2: str): | |
| # Read CSV files from the arguments | |
| df1, df2 = pd.read_csv(input1), pd.read_csv(input2) | |
| # Generate a comparison report | |
| report = sv.compare(df1, df2) | |
| # Render the HTML in your default browser | |
| report.show_html() |
This file contains hidden or 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 pandas as pd | |
| import sweetviz as sv | |
| import typer | |
| app = typer.Typer() | |
| @app.command() | |
| def report(input_path: str): | |
| # Read CSV file from the argument | |
| df = pd.read_csv(input_path) | |
| # Generate a reporte. | |
| report = sv.analyze(df) | |
| # Render HTML report in your default browser. | |
| report.show_html() | |
| # -------------------- MORE FEATURES HERE, LATER ----------------- | |
| if __name__ == "__main__": | |
| app() |
This file contains hidden or 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
| @app.command() | |
| def target(input_path: str, target: str): | |
| # Read CSV file from the argument | |
| df = pd.read_csv(input_path) | |
| # Generate a reporte. | |
| report = sv.analyze(df, target) | |
| # Render HTML report in your default browser. | |
| report.show_html() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment