-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
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
.loc behavior when using 'slice' #1158
Comments
thanks for reporting, let me take a look at this |
fix this at #1159 summarythe existing logic was determining range from start to stop by string order alphabetically, so couldn't keep natural order. we have to determine the range from start to stop with natural order like pandas. for more detailfor example, let's assume that we have >>> kdf
max_speed shield
cobra 1 2
viper 4 5
sidewinder 7 8 and perform >>> kdf.loc['cobra':'viper', 'max_speed'] and we expect that the result will not include 'sidewinder' since it is really not between 'cobra' and 'viper' shown so i fixed it with our new feature |
Resolve #1158 ```python >>> kdf max_speed shield cobra 1 2 viper 4 5 sidewinder 7 8 >>> kdf.loc['cobra':'viper', 'max_speed'] cobra 1 viper 4 Name: max_speed, dtype: int64 >>> kdf.to_pandas().loc['cobra':'viper', 'max_speed'] cobra 1 viper 4 Name: max_speed, dtype: int64 ```
I test as shown in the documentation below.
I found something strange.
https://koalas.readthedocs.io/en/latest/reference/api/databricks.koalas.Series.loc.html
pandas :
'sidewinder' is at the end of the list, so it prints normally.
but koalas prints 'sidewinder'
Input is done in the order ['cobra', 'viper', 'sidewinder'],
but koals appears to be recognized as ['cobra', 'sidewinder', 'viper'].
The text was updated successfully, but these errors were encountered: