def ProcessOneFluorescenceLine(Name, energy, minE, maxE): df = Features[Features[Name] == True] df['Fluor_centroid'] = 0.0 df['Fluor_amp'] = 0.0 df['Fluor_sigma'] = 0.0 minE, maxE = minE, maxE # st.write(df) for i, r in df.iterrows(): angstrom, eV, flux, error, angstrom_label, eV_label, flux_label, error_label = InterstellarXASTools.GetOneXMMSpectrum( config, int(r['obsid'])) eV_trim, flux_trim = InterstellarXASTools.GetSpectrumPortion( eV, flux, minE, maxE) x = FitFluorLine(eV_trim, flux_trim, energy) if x[2] > 0.001: df.at[i, 'Fluor_centroid'] = x[3] df.at[i, 'Fluor_amp'] = x[2] df.at[i, 'Fluor_sigma'] = x[4] else: df.at[i, 'Fluor_centroid'] = np.nan df.at[i, 'Fluor_amp'] = np.nan df.at[i, 'Fluor_sigma'] = np.nan st.write(df) df.to_csv(Name + '.csv') analysis = sv.analyze(df) analysis.show_html(filepath=Name + '.html')
def upload_csv(): if request.method == "POST": file = request.files["file"] # Save the file to ./uploads basepath = os.path.dirname(__file__) file_path = os.path.join(basepath, 'uploads', secure_filename(file.filename)) file.save(file_path) #processing and generating eda report in uploads folder df = pd.read_csv(file_path) filename_ = "uploads/" + file.filename + ".html" profile = ProfileReport(df, title=file.filename, explorative=True) profile.to_file(filename_) sweetviz_eda = sv.analyze(df) res = make_response( jsonify({ "message": "File " + file.filename + " uploaded successfully and report is Ready. " }), 200) #showing both reports in new tabs webbrowser.open_new_tab(file_path + ".html") sweetviz_eda.show_html() return res return render_template("inex.html")
def create_profile(df: pd.DataFrame): with put_loading(shape='grow'): report = sv.analyze(df) report.show_html() with open('SWEETVIZ_REPORT.html', 'r') as f: html = f.read() put_html(html)
def generate_profile(self): """Produces and saves the result profile in html form.""" profile = sv.analyze( pd.read_csv(self._filename)) profile.show_html( os.path.join(self._dst_folder, self.PROFILING_ARTIFACT), open_browser=False)
def analysis(df, targetfeat, config): pairwise_analysis = 'on' #相關性和其他型別的資料關聯可能需要花費較長時間。如果超過了某個閾值,就需要設定這個引數為on或者off,以判斷是否需要分析資料相關性。 report_train = sv.analyze([df, 'train'], target_feat=targetfeat, pairwise_analysis=pairwise_analysis) report_train.show_html( filepath='./report/{}_AnalysisReport.html'.fomrmat( config.modelFileKey)) # 儲存為html的格式
def generate_visulisation(dataset_path, vizualisation_path, options): log.info("Viz not found. Loading dataset") data = pd.read_csv(dataset_path, sep=None) data.drop(data.filter(regex="Unname"), axis=1, inplace=True) log.info("Generating viz") viz = sv.analyze(data, **options) log.info(f"Saving viz to {vizualisation_path}") viz.show_html(filepath=vizualisation_path, open_browser=False)
def main(): menu = ['Pandas-Profiling', 'SweetViz', 'D-tale', 'About'] option = st.selectbox("Select Tool for Viz", menu) if option == 'Pandas-Profiling': st.header("Pandas-Profiling") data_file = st.file_uploader("Upload_csv", type=['csv']) if data_file is not None: load_csv = pd.read_csv(data_file) st.write(load_csv.head()) st.success("Successfully uploaded!") if st.button('Generate Report'): report = ProfileReport(load_csv, title="CSV Profiling Report", explorative=True) st.write('---') st.header('**Pandas Profiling Report**') st_profile_report(report) elif option == 'SweetViz': st.header("SweetViz") data_file = st.file_uploader("Upload_csv", type=['csv']) st.success("Successfully uploaded!") if data_file is not None: load_csv = pd.read_csv(data_file) st.write(load_csv) st.write('---') st.header('**SweetViz Profiling Report**') if st.button('Generate Report'): report = sv.analyze(load_csv) report.show_html() display_sweetviz("SWEETVIZ_REPORT.html") elif option == 'D-tale': st.header('D-tale') data_file = st.file_uploader("Upload_csv", type=['csv']) st.success("Successfully uploaded!") if data_file is not None: load_csv = pd.read_csv(data_file) st.write(load_csv) st.write('---') st.header('**D-Tale Profiling Report**') if st.button('Generate Report'): dtale.show(load_csv) components.iframe('http://dell-virlgti:40000/dtale/main/1', width=1500, height=800, scrolling=True) # st.markdown(html, unsafe_allow_html=True) elif menu == 'About': st.subheader( "Simple tool for better and quick visualization and EDA!!") st.write() st.write( "check out this [link](https://share.streamlit.io/mesmith027/streamlit_webapps/main/MC_pi/streamlit_app.py)" )
def dummyGenReport(): # Method for initial creation of reports on platforms like heroku # region SweetViz Stuff sv.config_parser.read('svOverride.ini') # SweetViz Overrides dfReport = sv.analyze(myModel.get_dataset_forEDA()) filedirectory = os.getcwd() templatesString = 'templates' filename = 'svreport.html' dirString = filedirectory + os.sep + templatesString + os.sep + filename dfReport.show_html(filepath=dirString, open_browser="False", layout='widescreen') modReport.processSaveReport() # Custom modifications to report
def sweetviz_analyze(self, target_col: str) -> None: """ Analyze original dataframe and output as HTML file using sweetviz. https://github.com/fbdesignpro/sweetviz :param target_col: The name of the target column - str :return: None """ my_report = sweetviz.analyze([self.data, "Data"], target_col) my_report.show_html( "Report.html" ) # Not providing a filename will default to SWEETVIZ_REPORT.html
def sweetviz_analyze(df, context=None): import sweetviz as sv context = get_context(context) context.info(f"Sweetviz analyze") report = sv.analyze(df) with TemporaryDirectory() as tempdir: path = Path(tempdir) / "sweetviz_analyze_report.html" context.info(f"Using temporary file {path}") report.show_html(filepath=str(path), open_browser=False) with path.open() as f: return f.read()
def app(): train = pd.read_csv("Dataset/hepatitis.csv") train.head() train.tail() analysisofphosphate = sweetviz.analyze([train, "Train"], target_feat='alk_phosphate') # In[21]: analysisofphosphate.show_html('ReportEDAofalk_phosphate.html') # In[17]: # analysis of age analysisofage = sweetviz.analyze([train, "Train"], target_feat='age') # In[18]: analysisofage.show_html('ReportEDAofage.html')
def on_ok(): print(values['-FILE-']) df = pd.read_excel(values['-FILE-']) c = df.select_dtypes(include=['object']).columns df[c] = df[c].fillna('NA').apply(str) # i = df.select_dtypes(include=['int']).columns # df[i] = df[i].fillna(0).apply(int) # f = df.select_dtypes(include=['float']) # df[f] = df[f].fillna(0.0).apply(float) # d = df.select_dtypes(include=['datetime']) # df[d] = df[d].fillna(datetime(1900, 1, 1)).apply(datetime) my_report = sv.analyze(df) my_report.show_html()
def createSweetviz(dataFileName,sheetName = "DowntimeInfo",outputName = "Rockwell_sweetViz.html",showOnWeb = False,save2local=False): df = pd.read_excel(open(dataFileName, 'rb'), sheet_name=sheetName) df = df.drop(['DOWNTIME_ID','MRP_CONTROLLER_S','SALES_ORDER_NUM', 'RESPONDED_BY_USER_NAME_H','DT_COMMENTS','WORK_CENTER','ENTERED_BY_USER_NAME_H','LOGGED_UP_BY_USER_NAME_H'], axis=1) df['SOLUTION'].fillna("Don't Care", inplace = True) df['GROUP_NAME'].fillna("Don't Care", inplace = True) df['WORK_ORDER'].fillna("Don't Care", inplace = True) my_report = sv.analyze(df) # output= os.path.join(settings.BASE_DIR,r"HackathonProject\media\%s"%outputName) output = "A string" sweetviz_html = my_report.show_html(filepath=output,onWeb=showOnWeb,saveFile=save2local) # Default arguments will generate to "SWEETVIZ_REPORT.html" return sweetviz_html
def run_eda(df, dep_var="", chosen_val="Pandas Profiling"): if chosen_val == "Pandas Profiling": pr = ProfileReport(df, explorative=True) st_profile_report(pr) elif chosen_val == "Sweetviz": st.write("opening new tab") rep = sv.analyze( df.select_dtypes(exclude="datetime64[ns]"), target_feat=dep_var ) rep.show_html() elif chosen_val == "Autoviz": AV = AutoViz_Class() chart_format = "jpg" dft = AV.AutoViz( filename="", sep=",", depVar=dep_var, dfte=df, header=0, verbose=2, lowess=False, chart_format=chart_format, max_rows_analyzed=len(df), # 150000, max_cols_analyzed=df.shape[1], ) # 30 st.write(dft.head()) st.write("Autoviz") # st.write(os.getcwd()+f"/AutoViz_Plots/empty_string/*.{chart_format}") if dep_var != "": stored_folder = dep_var else: stored_folder = "empty_string" for i in list(glob(cwd + f"/AutoViz_Plots/{stored_folder}/*.{chart_format}")): st.image(Image.open(i)) elif chosen_val == "DataPrep": try: dpplot(df, *xy).show_browser() except: #s_buf = io.BytesIO() # dpplot(df).save(s_buf) stc.html(display_html(dpplot(df).report)) # .show_browser() # create_report(df).show_browser() elif chosen_val == "Summary Table": get_df(df)
def create_profile(df: pd.DataFrame = None, title: Optional[str] = 'Title'): profile = None with put_loading(shape='grow'): report = sv.analyze(df) # NOTE: Line below will take some time to complete... profile = report.show_html(layout='vertical') if profile: print(session_info.user_language) put_html(profile) else: put_markdown(t( r""" ## <p align="middle">_Errors occured analyzing the \"csv\" file._</p> """, r""" ## <p align="middle">_При анализе загруженного \"csv\" файла возникли ошибки._</p> """), strip_indent=4)
def load_data_file(patientID=-1, type='training', label=utils.ist_l, dir='data/', file='', verbose=True, graphs=False, analyze=False): if file == '': file = f'{patientID}-modified-{type}-{label}.csv' path = dir + file utils.print_h(f'Loading data from file {path}') # df = pd.read_csv(f'data/{patientID}-modified-{type}-{label}.csv', sep=';') df = pd.read_csv(path, sep=';') #set datetime type df = to_datetime(df, 'datetime') if verbose: print('Training data:') print(tabulate(df.head(20), headers='keys', tablefmt='psql')) print(df.describe().transpose(), end='\n\n') if analyze: report = sweetviz.analyze(df) report.show_html() if graphs: plot_graph(df, title='Whole dataset') plot_graph(df, end=288, title='24h dataset') plot_derivations(df, title='Whole dataset') plot_derivations(df, end=288, title='24h dataset') # df = replace_nan(df) return df
def make_sweetviz_report(df_train, df_val): print(f"\nSweetViz report start...") # # Code to view SweetViz configuration from config file # sweetviz.config_parser.read("Override.ini") # for sect in sweetviz.config_parser.sections(): # print("Section:", sect) # for k, v in sweetviz.config_parser.items(sect): # print(" {} = {}".format(k, v)) # print() sweetviz.config_parser.set(section="Layout", option="show_logo", value="0") feature_config = sweetviz.FeatureConfig(skip=None, force_text=None) #%% Create and save SweetViz report for train set sv_train = sweetviz.analyze(df_train, target_feat="rate", feat_cfg=feature_config) sv_train.show_html(reports_dir / f"SweeetViz_train.html") #%% Comparing two datasets (Validation vs Training sets) sv_compare = sweetviz.compare([df_train, "TRAIN"], [df_val, "VALID"], target_feat="rate", feat_cfg=feature_config) sv_compare.show_html(reports_dir / f"SweeetViz_compare.html")
import pandas as pd import sweetviz as sv pairwise_analysis = 'off' #相關性和其他型別的資料關聯可能需要花費較長時間。如果超過了某個閾值,就需要設定這個引數為on或者off,以判斷是否需要分析資料相關性。 train = pd.read_csv('D:/Projects/AI/poc/titanic/titanic/train.csv', index_col=0) test = pd.read_csv('D:/Projects/AI/poc/titanic/titanic/test.csv', index_col=0) report_train = sv.analyze([train, 'train']) # 'train'是指會給這個資料集命名為train report_train.show_html(filepath='Basic_train_report.html') # 儲存為html的格式 feature_config = sv.FeatureConfig( skip='Name', # 要忽略哪個特徵 force_cat=['Pclass', 'Sex', 'SibSp', 'Parch', 'Ticket', 'Cabin'], # Categorical特徵 force_num=['Age', 'Fare'], # Numerical特徵 force_text=None) # Text特徵 report_train_with_target = sv.analyze( [train, 'train'], target_feat='Survived', # 加入特徵變數 feat_cfg=feature_config) report_train_with_target.show_html( filepath='Basic_train_report_with_target.html') compare_report = sv.compare( [train, 'Training Data'], # 使用compare [test, 'Test Data'], 'Survived', feat_cfg=feature_config) compare_report.show_html(filepath='Compare_train_test_report.html')
#Change Legend plt.legend({'Furniture', 'Office Supplies', 'Technology'}) plt.show() """# Color""" sns.countplot(data=dataset, x='ship_mode', palette=['blue','yellow','red'], hue='category') plt.show() """# SweetViz""" !pip install sweetviz import sweetviz as sv my_report = sv.analyze(dataset[['profit', 'sales', 'Cost', 'quantity']].sample(frac=0.2)) my_report.show_notebook() country = dataset.loc[dataset.country.isin(['Germany', 'United Kingdom'])] sns.countplot(y='country', data=country, order=['Germany', 'United Kingdom'], palette=['Red', 'yellow']) plt.show() # country['country'].value_counts().index """# Plotly Express""" import plotly.express as px fig = px.violin(dataset, y='sales', x='ship_mode') fig.show()
for x in range(len(arquivo)): registro = {} registro['id'] = arquivo[x]['id'] registro['forks'] = arquivo[x]['forks'] registro['language'] = arquivo[x]['language'] registro['created_at'] = arquivo[x]['created_at'] lista.append(registro) return lista #================================================================================# # MAIN # #================================================================================# nome_base_dados = "base_dados_repositorios.json" if arquivo_json_existe(nome_base_dados): base_dados_json = ler_arquivo_json(nome_base_dados) base_dados = base_dados_json['items'] lista = seleciona_informacoes_repositorio_json(base_dados) # Transforma o arquivo json em um data frame data_frame = pd.json_normalize(lista) analise_dados = sv.analyze(data_frame) analise_dados.show_html('analise_dados.html') else: print(f'Erro - Arquivo {str(nome_base_dados)} não foi localizados!')
def structured_data_app(): st.write("Welcome to the DQW for structured data analysis. ", "Structured data analysis is an important step ", "in AI model development or Data Analysis. This app ", "offers visualisation of descriptive statistics of a ", "csv input file by using the sweetviz package.", " You can pick to analyse only 1 file or compare 2.") # Side panel setup # Step 1 includes Uploading display_app_header(main_txt="Step 1", sub_txt="Upload data", is_sidebar=True) data_input_mthd = st.sidebar.radio( "Select Data Input Method", ('Upload a CSV file', 'Upload a json file')) selected_structure = st.selectbox("Choose type of analysis", ("Analyse 1 file", "Compare 2 files")) if selected_structure == "Compare 2 files": st.subheader('Choose data to analyse :alembic:') uploaded_files = st.file_uploader("Upload CSVs to compare", type="csv", accept_multiple_files=True) data = [] for file in uploaded_files: dataframe = pd.read_csv(file) file.seek(0) data.append(dataframe) st.subheader( 'A preview of input files is below, please wait for data to be compared :bar_chart:' ) st.write(data[0].head(5)) st.write(data[1].head(5)) my_report = sv.compare([data[0], "Input file 1"], [data[1], "Input file 2"]) my_report.show_html(layout='vertical', open_browser=True) #profile = ProfileReport(data, title='Your input data profile report').to_html() display = open("SWEETVIZ_REPORT.html", 'r', encoding='utf-8') source_code = display.read() # display html page in streamlit components.html(source_code, height=600, scrolling=True) if selected_structure == "Analyse 1 file": st.subheader('Choose data to analyse :alembic:') data, txt = check_input_method(data_input_mthd) st.subheader( 'A preview of input data is below, please wait for data to be analyzed :bar_chart:' ) st.write(data.head(5)) my_report = sv.analyze(data) my_report.show_html(layout='vertical', open_browser=True) #profile = ProfileReport(data, title='Your input data profile report').to_html() display = open("SWEETVIZ_REPORT.html", 'r', encoding='utf-8') source_code = display.read() # display html page in streamlit components.html(source_code, height=600, scrolling=True)
def sweet_test_train_report(csv): df = pd.read_csv(csv) my_report = sv.analyze(df) my_report.show_html() print("report made") pass
def main(): st.title("Simple app") menu = ['Home', 'Sweetviz', 'About'] choice = st.sidebar.selectbox('Menu', menu) if choice == 'Sweetviz': st.subheader("Automated EDA with Sweetviz") data_file = st.file_uploader("Upload CSV", type=['csv']) if data_file is not None: df = pd.read_csv(data_file) st.dataframe(df.head()) if st.button("Generate Sweetviz Report"): # Normal Workflow report = sv.analyze(df) report.show_html() st_display_sweetviz("SWEETVIZ_REPORT.html") elif choice == "About": st.subheader("About App") # components.iframe('https://jcharistech.com') components.html(footer_temp, height=500) else: st.subheader("Home") # components.html("<p style='color:red;'> Streamlit is awesome</p>") html_temp = """ <div style="background-color:royalblue;padding:10px;border-radius:10px"> <h1 style="color:white;text-align:center;">Simple EDA App with Streamlit Components</h1> </div> """ # components.html("<p style='color:red;'> Streamlit Components is Awesome</p>") components.html(html_temp) components.html(""" <style> * {box-sizing: border-box} body {font-family: Verdana, sans-serif; margin:0} .mySlides {display: none} img {vertical-align: middle;} /* Slideshow container */ .slideshow-container { max-width: 1000px; position: relative; margin: auto; } /* Next & previous buttons */ .prev, .next { cursor: pointer; position: absolute; top: 50%; width: auto; padding: 16px; margin-top: -22px; color: white; font-weight: bold; font-size: 18px; transition: 0.6s ease; border-radius: 0 3px 3px 0; user-select: none; } /* Position the "next button" to the right */ .next { right: 0; border-radius: 3px 0 0 3px; } /* On hover, add a black background color with a little bit see-through */ .prev:hover, .next:hover { background-color: rgba(0,0,0,0.8); } /* Caption text */ .text { color: #f2f2f2; font-size: 15px; padding: 8px 12px; position: absolute; bottom: 8px; width: 100%; text-align: center; } /* Number text (1/3 etc) */ .numbertext { color: #f2f2f2; font-size: 12px; padding: 8px 12px; position: absolute; top: 0; } /* The dots/bullets/indicators */ .dot { cursor: pointer; height: 15px; width: 15px; margin: 0 2px; background-color: #bbb; border-radius: 50%; display: inline-block; transition: background-color 0.6s ease; } .active, .dot:hover { background-color: #717171; } /* Fading animation */ .fade { -webkit-animation-name: fade; -webkit-animation-duration: 1.5s; animation-name: fade; animation-duration: 1.5s; } @-webkit-keyframes fade { from {opacity: .4} to {opacity: 1} } @keyframes fade { from {opacity: .4} to {opacity: 1} } /* On smaller screens, decrease text size */ @media only screen and (max-width: 300px) { .prev, .next,.text {font-size: 11px} } </style> </head> <body> <div class="slideshow-container"> <div class="mySlides fade"> <div class="numbertext">1 / 3</div> <img src="https://www.w3schools.com/howto/img_nature_wide.jpg" style="width:100%"> <div class="text">Caption Text</div> </div> <div class="mySlides fade"> <div class="numbertext">2 / 3</div> <img src="https://www.w3schools.com/howto/img_snow_wide.jpg" style="width:100%"> <div class="text">Caption Two</div> </div> <div class="mySlides fade"> <div class="numbertext">3 / 3</div> <img src="https://www.w3schools.com/howto/img_mountains_wide.jpg" style="width:100%"> <div class="text">Caption Three</div> </div> <a class="prev" onclick="plusSlides(-1)">❮</a> <a class="next" onclick="plusSlides(1)">❯</a> </div> <br> <div style="text-align:center"> <span class="dot" onclick="currentSlide(1)"></span> <span class="dot" onclick="currentSlide(2)"></span> <span class="dot" onclick="currentSlide(3)"></span> </div> <script> var slideIndex = 1; showSlides(slideIndex); function plusSlides(n) { showSlides(slideIndex += n); } function currentSlide(n) { showSlides(slideIndex = n); } function showSlides(n) { var i; var slides = document.getElementsByClassName("mySlides"); var dots = document.getElementsByClassName("dot"); if (n > slides.length) {slideIndex = 1} if (n < 1) {slideIndex = slides.length} for (i = 0; i < slides.length; i++) { slides[i].style.display = "none"; } for (i = 0; i < dots.length; i++) { dots[i].className = dots[i].className.replace(" active", ""); } slides[slideIndex-1].style.display = "block"; dots[slideIndex-1].className += " active"; } </script> """)
def sweetviz_report(data, target_feature): my_report = sweetviz.analyze(data) return (my_report.show_html('Report.html'))
print("Media de Contaminados:{:.2f} ".format(df['C_Acu_Dia'].mean())) plt.hist('C_Acu_Dia',data = df,bins = 8,density = False) plt.show() df.plot.scatter(x='C_Acu_Dia', y = 'O_Acu_Dia',s=60) plt.show() df.boxplot(['C_Acu_Dia','O_Acu_Dia']) corr = df[['C_Acu_Dia','O_Acu_Dia']].corr() display(corr) sns.heatmap(corr,cmap='RdBu', fmt = '.2f', square = True,linecolor='white', annot=True) !pip install https://github.com/pandas-profiling/pandas-profiling/archive/master.zip -q import pandas as pd #biblioteca pandas from pandas_profiling import ProfileReport #biblioteca para usar profile report report = ProfileReport(df) #cria o profile report report.to_notebook_iframe() #gera overview dos dados ! pip install sweetviz -q # INSTALA SWEETVIZ import sweetviz relatorio_sweet = sweetviz.analyze(df) relatorio_sweet.show_html('Teste.html')
from sklearn.model_selection import StratifiedKFold # Create StratifiedKFold object. skf = StratifiedKFold(n_splits=10, shuffle=True, random_state=1) lst_accu_stratified = [] for train_index, test_index in skf.split(X, Y): x_train_fold, x_test_fold = X[train_index], X[test_index] y_train_fold, y_test_fold = Y[train_index], Y[test_index] xgboost_downsampled.fit(x_train_fold, y_train_fold) lst_accu_stratified.append( xgboost_downsampled.score(x_test_fold, y_test_fold)) # Print the output. print('List of possible accuracy:', lst_accu_stratified) print('\nMaximum Accuracy That can be obtained from this model is:', max(lst_accu_stratified) * 100, '%') print('\nMinimum Accuracy:', min(lst_accu_stratified) * 100, '%') print('\nOverall Accuracy:', np.mean(lst_accu_stratified) * 100, '%') print('\nStandard Deviation is:', np.std(lst_accu_stratified)) """With downsampling xgboost gives very less accuracy i.e. 50% only""" # importing sweetviz import sweetviz as sv #analyzing the dataset EDA_report = sv.analyze(insurance_data) #display the report EDA_report.show_html( '/content/drive/MyDrive/Colab Notebooks/insurance_data.html')
# ライブラリの読み込み import numpy as np import pandas as pd # グラフィックスのフォントはソースコード内で "Noto Sans CJK" に決め打ちされている import sweetviz as sv sv.config_parser.read('sweetviz_settings.ini') # データの読み込み df1 = pd.read_csv('https://raw.githubusercontent.com/ltl-manabi/py_sweetviz_example/main/pseudo_classification_data.csv') df2 = pd.read_csv('https://raw.githubusercontent.com/ltl-manabi/py_sweetviz_example/main/weather_data_mod.csv') # Sweetvizインスタンスの作成 my_report1 = sv.analyze(df1) my_report2 = sv.analyze(df2) # レポートの作成 my_report1.show_html(filepath='sweetviz_report01.html', open_browser=False) my_report2.show_html(filepath='sweetviz_report02.html', open_browser=False) my_report2.show_html(filepath='sweetviz_report02_vertical.html', open_browser=False, layout='vertical') # データの比較 (`compare_intra()` 関数、`compare()` 関数) # データフレーム内の比較 (`compare_intra()` 関数)
# + hidden=true from pandas_profiling import ProfileReport # + hidden=true profile = ProfileReport(df, title='Pandas Profiling Report', explorative=True) # + hidden=true profile.to_file("../../outputs/profiling/Stroke_Detection_pandas_profiling.html") # + hidden=true profile.to_notebook_iframe() # + [markdown] heading_collapsed=true # ## Sweetviz Profiling # + hidden=true import sweetviz as sv # + hidden=true my_report = sv.analyze(df) my_report.show_html('../../outputs/profiling/Stroke_Detection_sv_profiling.html') # Default arguments will generate to "SWEETVIZ_REPORT.html" # + hidden=true my_report.show_notebook( w='100%', h='Full', scale=0.8, layout='widescreen') # + hidden=true
title= f"UV over Time<br>City: {city}<br><b>{datetime.strftime(datetime.today(),'%d %b %Y')}</b>", xaxis_title="Time", yaxis_title="UV Index", font=dict(family="Courier New, monospace", size=18, color="RebeccaPurple"), plot_bgcolor=air_quality_color, annotations=[ dict( xref='x', yref='y', x='12:00 AM', y=0.5, showarrow=False, text= f'Air Quality: <b>{air_quality_index}</b> <br>({air_quality_rating})' ) ]) fig.show() fig.write_html('today_uv.html') fig.write_image('today_uv.jpg') airQuality.graph_forecast() answer = questionary.confirm("display analytics?").ask() if answer == True: sweetviz = sv.analyze(whole_df) sweetviz.show_html()
def sweet_make_report(csv): df = pd.read_csv(csv) my_report = sv.analyze(df) my_report.show_html() print("report made")