I am working with this csv https://drive.google.com/file/d/1o3Nna6CTdCRvRhszA01xB9chawhngGV7/view?usp=sharing
I am trying to sort by the 'Taxes' column, but when I use
import pandas as pd
df = pd.read_csv('statesFedTaxes.csv')
df.Taxes.values.sort_values()
I get
AttributeError: 'numpy.ndarray' object has no attribute 'sort_values'
This is baffling to me and I cannot find a similar problem online. How can I sort the data by the "Taxes" column?
EDIT: I should explain that my real problem is that when I use
df.sort_values('Taxes')
I get this output:
State Taxes
48 Washington 100,609,767
24 Minnesota 102,642,589
25 Mississippi 11,273,202
13 Idaho 11,343,181
30 New Hampshire 12,208,656
54 International 12,611,648
22 Massachusetts 120,035,203
40 Rhode Island 14,325,645
31 New Jersey 140,258,435
Therefore, I assume the commas are getting in the way of my chart sorting properly. How do I get over this?
DataFrame.valuesdocs: We recommend usingDataFrame.to_numpy()instead. (This name should help you understand error i.e., trying to sorting on numpy array).