I have already checked stackoverflow for any similar question but there is no answer to this.
Recently I started learning data visualization in python. This is the data frame I worked upon: Immigration to Canada (virtual data)
This is the code:
import matplotlib as mpl
import matplotlib.pyplot as plt
import pandas as pd
df = pd.read_excel('icdf.xlsx')
df.plot(kind="line")
plt.title('Immigration to Canada (virtual data)')
plt.xlabel('Years')
plt.ylabel('Number of immigrants')
plt.show()
Now, on running the above code I get this plot: Line Plot for the data frame
Why does the x-axis has 9 values viz. (1980.0, 1980.5, 1981.0, 1981.5, 1982.0,...) whereas according to the data frame it is expected to have 5 values viz. (1980, 1981, 1982,...)?