0

Daily Report for my ID

It starts from the row number 3

We currently do not have PowerBi, hence i am going for the Matplotlib which can extract the saved data from EXCEL and then plot it with Matplotlib

Here's the code which i have written, and i encounter a output wherein i am unable to proceed with any changes because of confusion:

import matplotlib.pyplot as plt

import xlrd

import pandas as pd

df = pd.read_excel('C:\CATS.xls', skiprows = 3)

x = plt.plot(['Mack Trucks'], ['Volvo Construction Equipment'], ['Volvo Trucks'])


plt.ylabel('VOLVO GROUP')

plt.show()

Output

Request anyone who can help me here, i need the company brands to be in Y - AXIS and print the remaining values in the X-axis

The one provided by me is only my data, similarly i will have other 10 to 12 team mate data in it.

3

1 Answer 1

1

You need to check the data you are trying to plot. What are the errors you are getting as the code doesn't seem to be calling the series (columns) from the dataframe correctly. You also import xlrd but don't use it (pandas can read excel files anyway).

For example a dataframe with 2 columns called 'xcol' and 'ycol' which are populated with values. In your example you are not referencing the dataframe in your call to plt().

To plot these you would call:

plt.plot(df['xcol'], df['ycol']) # note 'df['xcol']' not just ['xcol']
plt.show()

Also, you don't say what you are trying to plot from your data.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.