Generating Targeted Insights
Once we have identified the KPIs for our analysis, we can proceed to make insights with respect to only those variables that affect the bottom line of the KPIs.
Selecting and Renaming Attributes
After we have explored our attributes, we might feel like the variation in the data for a certain attribute could be understood more clearly if it were focused on individually. As explained in detail in the previous chapter, we can select parts of data in pandas through the following methods:
[cols]: This method selects the columns to be displayed.
loc[label]: This method selects rows by label or Boolean condition.
loc[row_labels, cols]: This method selects rows in row_labels and their values in the cols columns.
iloc[location]: This method selects rows by integer location. It can be used to pass a list of row indices, slices, and so on.
For example, we can select Revenue, Quantity, and Gross Profit columns from the United States in the sales DataFrame, as follows:
sales...