8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider the following dataframe:
df = pd.DataFrame([[179293473,'2016-06-01 00:00:03.549745','http://www.dr.dk/nyheder/',39169523],[179293473,'2016-06-01 00:04:22.346018','https://www.information.dk/indland/2016/05/hvert-tredje-offer-naar-anmelde-voldtaegt-tide', 39125224], [179773461, '2016-06-01 22:13:16.588146', 'https://www.google.dk', 31658124], [179773461, '2016-06-01 22:14:04.059781', 'https://www.google.dk', 31658124], [179773461, '2016-06-01 22:16:37.230587', np.nan, 31658124], [179773461, '2016-06-01 22:23:09.847149', 'https://www.google.dk', 32718401], [179773461, '2016-06-01 22:23:55.158929', np.nan, 32718401], [179773461, '2016-06-01 22:27:00.857224', np.nan, 32718401]], columns=['SessionID', 'PageTime', 'ReferrerURL', 'PageID'])
which looks like this:
Run: df.groupby('SessionID').nth(-1)
df.groupby('SessionID').nth(-1)
Out:
nth()
The text was updated successfully, but these errors were encountered:
@mroeschke @jreback Not sure if this is a bug but it would be nice if the nth() won't change the orders of the columns.
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Consider the following dataframe:
which looks like this:
Run:
df.groupby('SessionID').nth(-1)
Out:
Question: Why has
nth()
mixed the order of my columns?The text was updated successfully, but these errors were encountered: