Skip to content
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

Syntax / macros for slices in numpy/pandas/etc. #1818

Closed
asemic-horizon opened this issue Sep 8, 2019 · 1 comment
Closed

Syntax / macros for slices in numpy/pandas/etc. #1818

asemic-horizon opened this issue Sep 8, 2019 · 1 comment

Comments

@asemic-horizon
Copy link

asemic-horizon commented Sep 8, 2019

I'm doing a Kaggle contest this weekend and noting a couple of patterns in typical EDA Python work that are awkward in Hy.

  1. Multidimensional slicing like X[i,j], X[a:b,j], X[i,:].
  2. Conditional slices like X[X.type == "N"]
  3. Chained slices like X[X.type == "N"]["value"]

The latter, for example, looks like

 (get (get X (= (get X "type") "N")) "value"))

Can we consider this a feature request? It takes learning some numpy to figure out what are the explicit functions behind the syntax sugar, so it may not get done in any foreseeable future -- but it's a common Python use case and thus a major selling point for Hy.

@Kodiologist
Copy link
Member

Duplicate of #541.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants