Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Mar 17, 2022
For those who are struggling to translate your R code into python, you might want to take a look at this package:
which reimages pandas APIs and aligns them with tidyverse's.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Wonderful notebook! Helps me know R better. There might be something that will help others know pandas better.
Anyway, as in
flights.iloc[:9]is fine. But wouldn't
flights.loc[:10]be more equivalent?
I'm only guessing what the R code does, but how about
flights.loc[:, 'year':'day']? And if there's a list of columns to get, named
columnsfor example, I think
flights[columns]will do, other than
If I'm guessing right,
flights.loc[:, ~flight.columns.isin(a.loc[:, 'year':'day'])]might do. But it's a little bit tedious and less elegant than R.
Again, a very helpful notebook.