![]() ![]() ![]() This isn't utterly important though, and I'm just trying to learn using python, and the actual work has been done in excel. Then you call plot () and pass the DataFrame object’s 'Rank' column as the first argument and the 'P75th' column as the second argument. I have come across a few other posts related to this issue, but not seen one that specifically addresses the renaming of individual labels. First, you import the matplotlib.pyplot module and rename it to plt. This is the error I get when using the above code.ĪttributeError: 'Series' object has no attribute 'set_ylabel' I have tried to rename the x-axis labels using the code below. Test Train Data Splitting: The dataset is then divided into two parts: a training set and a testing set. Pd.set_option('display.mpl_style', 'default')įixed_data = pd.read_csv('audit-rep.csv',sep=',',encoding='latin1',index_col='Index', parse_dates=,dayfirst=False) Data Collection: The first step in creating a decision tree regression model is to collect a dataset containing both input features (also known as predictors) and output values (also called target variable). This is the code I have used, and except for the label names, I am happy with the result. Instead of having these verbose reasons though, I would like to rename the X-Axis labels to just numbers or alphabets so that the graph reads somewhat like this: Vendor Registration not on record.another 300 words - 9 The df.plot() function returns a object.No contract with vendor.another 300 words - 14.Not approved by regional committee.another 300 words - 17.The problem I am facing is renaming the X-Axis labels.Įssentially, the chart is trying to plot a count of different types of Audit Violations, but has really long descriptions of the said violations. I have a CSV file that I am trying to read using Python, and looking to come up with charts. Include the x and y arguments like this: x 'Duration', y 'Calories'. In the example below we will use 'Duration' for the x-axis and 'Calories' for the y-axis. a.txt plot Now I want to hide some parts of the data, ie I want to set all y-values for an interval x to 0 or better hide them completely, the rest of the plot shouldnt disappear. Specify that you want a scatter plot with the kind argument: kind 'scatter'. I'm running my code on iPython Notebooks, on a Macbook Pro Yosemite 10.10.4 I am importing data from a.txt file and plot it, that is working.
0 Comments
Leave a Reply. |