def test_with_data_source(mpg_df):
    from pandas_visual_analysis import VisualAnalysis, DataSource

    df = mpg_df

    ds = DataSource(df)
    VisualAnalysis(ds)
def test_with_cat_cols(mpg_df):
    from pandas_visual_analysis import VisualAnalysis

    df = mpg_df

    VisualAnalysis(
        df, categorical_columns=["name", "origin", "model_year", "cylinders"])
def test_visual_analysis_alpha(mpg_df):
    from pandas_visual_analysis import VisualAnalysis

    VisualAnalysis(mpg_df,
                   select_color="#323EEC",
                   deselect_color="#8A8C93",
                   alpha=0.75)
def test_visual_analysis_row_height_list(mpg_df):
    from pandas_visual_analysis import VisualAnalysis

    VisualAnalysis(
        mpg_df,
        layout=[["Scatter", "Scatter"], ["ParallelCoordinates"]],
        row_height=[200, 300],
    )
コード例 #5
0
 def test_visual_analysis_color_value_error(self, small_df):
     with pytest.raises(ValueError):
         VisualAnalysis(small_df, select_color=(500, 0, 0))
コード例 #6
0
 def test_visual_analysis_object_creation_deselect_color_type_error(
         self, small_df):
     with pytest.raises(TypeError):
         VisualAnalysis(small_df, deselect_color=set([0, 0, 0]))
コード例 #7
0
 def test_visual_analysis_object_creation_color_error2(self, small_df):
     with pytest.raises(ValueError):
         VisualAnalysis(small_df, select_color="#asdfasdfa")
def test_visual_analysis_row_height(mpg_df):
    from pandas_visual_analysis import VisualAnalysis

    VisualAnalysis(mpg_df, row_height=300)
コード例 #9
0
 def test_ipython_display(self, small_df):
     va = VisualAnalysis(small_df)
     va._ipython_display_()
コード例 #10
0
 def test_visual_analysis_sample_number_neg_error(self, int_df):
     with pytest.raises(ValueError):
         VisualAnalysis(int_df, sample=-100)
コード例 #11
0
 def test_visual_analysis_sample_input_error(self, int_df):
     with pytest.raises(TypeError):
         VisualAnalysis(int_df, sample="asdfa")
コード例 #12
0
 def test_visual_analysis_object_creation_non_int_index(
         self, small_df_index):
     assert VisualAnalysis(small_df_index)
コード例 #13
0
 def test_init_with_data_source(self, small_df):
     ds = DataSource(small_df, None)
     assert VisualAnalysis(data=ds)
コード例 #14
0
 def test_visual_analysis_row_height_neg_error(self, small_df):
     with pytest.raises(ValueError):
         VisualAnalysis(small_df, row_height=-10)
コード例 #15
0
 def test_visual_analysis_object_creation(self, small_df):
     assert VisualAnalysis(small_df)
コード例 #16
0
 def test_visual_analysis_row_height_type_error(self, small_df):
     with pytest.raises(TypeError):
         VisualAnalysis(small_df, row_height="100px")
コード例 #17
0
 def test_warn_cat_cols(self, small_df):
     small_df.drop(columns=["b"], inplace=True)
     with pytest.warns(UserWarning):
         VisualAnalysis(small_df, layout=[["ParallelCategories"]])
コード例 #18
0
 def test_visual_analysis_warn_num_cols(self, small_df):
     small_df.drop(columns=["c"], inplace=True)
     with pytest.warns(UserWarning):
         VisualAnalysis(small_df, layout=[["ParallelCoordinates"]])
コード例 #19
0
 def test_visual_analysis_object_creation_alpha_type_error(self, small_df):
     with pytest.raises(TypeError):
         VisualAnalysis(small_df, alpha=[0.5])
コード例 #20
0
 def test_data_type_error(self):
     with pytest.raises(TypeError):
         VisualAnalysis(data=[1, 2, 3])
コード例 #21
0
 def test_visual_analysis_alpha_error(self, small_df):
     with pytest.raises(ValueError):
         VisualAnalysis(small_df, alpha=1.4)
コード例 #22
0
def test_visual_analysis_sample(mpg_df):
    from pandas_visual_analysis import VisualAnalysis

    va = VisualAnalysis(mpg_df, sample=100)

    assert len(va.data_source) == 100
コード例 #23
0
def test_default(mpg_df):
    from pandas_visual_analysis import VisualAnalysis

    df = mpg_df

    VisualAnalysis(df)
コード例 #24
0
df.isnull().sum()


# In[14]:


df_Train =df


# # Data Analysis - Visualization and Exploration

# In[15]:


VisualAnalysis(df_Train)   ##Interactive Dashboard #Each Metric can be used to select the required 


# In[16]:


for indx in ['Income_of_Applicant', 'Income_of_Joint_Applicant', 'Loan_Amount_Requirement']:
 sns.boxplot(df_Train[indx].dropna(),orient='a')
 plt.title(indx)
 plt.show()


# # Dealing with missing value

# In[17]:
コード例 #25
0
 def test_visual_analysis_sample_frac_large_error(self, int_df):
     with pytest.raises(ValueError):
         VisualAnalysis(int_df, sample=10.4)
コード例 #26
0
 def test_visual_analysis_object_creation_color_high_value_error(
         self, small_df):
     with pytest.raises(ValueError):
         VisualAnalysis(small_df, deselect_color=(0, 0, 500))
コード例 #27
0
 def test_visual_analysis_color_tuple(self, small_df):
     assert VisualAnalysis(small_df, select_color=(12, 12, 12))
コード例 #28
0
    def test_visual_analysis_display_system(self, int_df):
        va = VisualAnalysis(int_df, [["Scatter"]])
        from IPython.core.display import display

        display((va, ))
コード例 #29
0
 def test_visual_analysis_object_creation_color(self, small_df):
     assert VisualAnalysis(small_df,
                           select_color="#ffffff",
                           deselect_color=(0, 0, 0))
コード例 #30
0
def test_widget_class_registry_normal_behaviour():
    small_df = sample_dataframes.small_df()
    VisualAnalysis(small_df)
    assert len(WidgetClassRegistry().widget_list) > 0