Skip to content

Instantly share code, notes, and snippets.

@thuwarakeshm
Last active August 14, 2021 10:26
Show Gist options
  • Save thuwarakeshm/909ada186307a0f04faaeaa0eeff6a0c to your computer and use it in GitHub Desktop.
Save thuwarakeshm/909ada186307a0f04faaeaa0eeff6a0c to your computer and use it in GitHub Desktop.
Analysis in a blink
@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()
#! /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()
# -------------------- 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()
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()
@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