-1
Ich habe einen ValueError erhalten, wenn ich einen groupby Rang gemacht habe.ValueError beim Ausführen von df.groupby ('col1'). Col2.rank() mit Pandas in Python 2
Wie berechne ich das gruppierte Ranking richtig?
df = pd.concat([pd.DataFrame(dict(col1=[1,2,3], col2=[4,5,6])),
pd.DataFrame(dict(col1=[1,2,3], col2=[7,8,9]))])
df.groupby('col1').col2.rank()
Mit Valueerror
Traceback (most recent call last):
File "<input>", line 1, in <module>
NameError: name 'col1' is not defined
df.groupby('col1').col2.rank()
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "<string>", line 35, in rank
File "/Users/stephenpettinato/.virtualenvs/newt-env/lib/python2.7/site-packages/pandas/core/groupby.py", line 592, in wrapper
raise ValueError
ValueError