0
$\begingroup$

I am using the EU stock market dataset, and applied a box-cox transformation to each time series using stats.boxcox from the scipy module.

The resulting data frame is df_box_cox.

df_box_cox.info()

<class 'pandas.core.frame.DataFrame'>
RangeIndex: 1860 entries, 0 to 1859
Data columns (total 4 columns):
 #   Column  Non-Null Count  Dtype  
---  ------  --------------  -----  
 0   DAX     1860 non-null   float64
 1   SMI     1860 non-null   float64
 2   CAC     1860 non-null   float64
 3   FTSE    1860 non-null   float64
dtypes: float64(4)
memory usage: 58.2 KB

When I run df_box_cox["DAX"].plot(), I get:

enter image description here

Why do I get that pesky number on the top left?

$\endgroup$

2 Answers 2

0
$\begingroup$

This is more of a programming question than a data science question and would therefore be better suited to the stackoverflow stackexchange. The numbers you are seeing are related to ticklabel formats used by the matplotlib library. Changing the axis settings should allow you to get rid of the numbers on the top left of the plot:

ax.ticklabel_format(useOffset=False, style='plain')
# or
plt.ticklabel_format(useOffset=False, style='plain')

For more in-depth information on the offset and style see this stackoverflow answer or the matplotlib documentation.

$\endgroup$
1
  • $\begingroup$ Thanks! I wasn't sure where to post the question... $\endgroup$ Commented Nov 23, 2021 at 12:01
0
$\begingroup$

Adapting to my setting,

axes = df_box_cox["DAX"].plot()

axes.ticklabel_format(axis='y', useOffset=False,style='plain')
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.