If the object of study is standalone and not connected in any way with its nearest neighbors, then a bar graph is better suited for carrying out the analysis given that it emphasizes the isolation of the data. A bar graph is plotted using the plot () method. The graph type is passed as the parameter: kind='bar'.
data.plot(y='column', kind='bar');
However, if there are a lot of objects and not all of them have targets that are sufficiently high, you can group them together for further processing. In this case, grouping can be done as selective renaming.
In order to selectively change value the where() method is used. Two parameters are passed to it: a Boolean array and new values. If the Boolean array is True, then the value corresponding to it will not change; if it is False, then the value will change to the second parameter of the method.
data['column'].where(s > control_value, default_value)
In some cases, a pie chart can be appropriately used to visualize the data since it is good for demonstrating a share of each value when the total is 100%. In order to create a pie chart, it is enough to set kind='pie' in the .plot. In this case, it is necessary to set the data column by the y parameter:
data.plot(y='column', kind='pie');
It’s not always practical to apply standard methods when working with data that is dependent on certain separate values in the column. In order to work with data by groups, there is the groupby () method that automatically goes through unique values. Pass it a column, and it’ll return a sequence of pairs “value of the column — slice of data with this value”. In the future, we’ll be able to process these slices according to our needs.
for column_value, column_slice in data.groupby('column'):
# do something