0

I've got some problems with my scatter_matrix plots.

Basically I've got a dataframe df consisting of 19 columns, i.e.

df.columns = ['A','B',...'S']

The column 'A' contains only int values between 1 and 2. The scatter_matrix applied to df

pd.plotting.scatter_matrix(df,diagonal = 'kde', ax = ax_values1_2)

returns the desired 19x19 matrix plot.

If I split the dataframe in two seperate dataframes df_1 and df_2 which consits of the same data except that df_1 consits of all values where df.A = 1 and analog df_2 got the values where df.A=2.

If I now apply scatter_matrix to These new dataframes:

pd.plotting.scatter_matrix(df_1,diagonal = 'kde', ax = ax_values1_2)
pd.plotting.scatter_matrix(df_2,diagonal = 'kde', ax = ax_values1_2)

I get 2 metrices of size 9x9.

So I guess 'scatter_matrix' filters the rows out of the plot, where there seems to be no relevant Information. Am I right at this point?

So my question is: how to force scatter_matrix to plot the full 19 columns even there might be no sense.

Maybe there is some theretical or easy answer for this problem. If not I could deliver in addition the Code that causes the problem.

Danny Abstemio
  • 121
  • 2
  • 6
  • Your question would definitely benefit from a [MCVE]. – IanS Aug 31 '18 at 11:34
  • Specifically for pandas, check this: https://stackoverflow.com/questions/20109391/how-to-make-good-reproducible-pandas-examples – IanS Aug 31 '18 at 11:35

1 Answers1

0

Thanks, for all the advises to improve the quality of asking for help.

Meanwhile I found a solution for my problem. In case someone else would be faced with the same Problem, the solution for me was to change the diagonal Parameter in scatter_matrix to hist.

It seems that scatter_matrix won't throw aways colums with only one single value per column if hist is chosen.

Danny Abstemio
  • 121
  • 2
  • 6