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

[Bug] Errors filtering/selecting data from dataframes in R #225

Open
annahadji opened this issue Nov 14, 2019 · 3 comments
Open

[Bug] Errors filtering/selecting data from dataframes in R #225

annahadji opened this issue Nov 14, 2019 · 3 comments
Assignees
Labels

Comments

@annahadji
Copy link
Collaborator

I've found a bug in R cells in wrattler when trying to take sections of dataframes in cases such as below:

Case 1:

cols <- c("scenic_rating", "population_density_area_hectares", "employment_score_rate")
d <- data.frame(column = cols, bin_width = c(0.05, 10, 0.05))
feature <- as.character(d[1,]$column) # we would expect "scenic_rating" to be returned

Case 2:

# here we're trying to filter a dataframe by the value of a particular column
subset_df = df[ which(df$crime_category=='total_count'), ] 

Both of the above cases run normally in R, but return the following error message in wrattler:
Error message "Error in walkCode(a, w) : argument "a" is missing, with no default"

@annahadji
Copy link
Collaborator Author

Alternative solution for Case 1:

cols <- c("scenic_rating", "population_density_area_hectares", "employment_score_rate")
d <- data.frame(column = cols, bin_width = c(0.05, 10, 0.05))
feature <- as.character(d[[1]][1]) # features now gives "scenic_rating"

@annahadji
Copy link
Collaborator Author

Alternative solution(s) for Case 2:

Either do the filtering of columns in a Python cell in wrattler, or
subset_df = subset(df, crime_category=='total_count')

@annahadji
Copy link
Collaborator Author

annahadji commented Nov 18, 2019

However, I wouldn't say either of these workarounds are exactly ideal since both of the original cases are common approaches to filtering data in R. Additionally, in particular in case (1) it requires knowing the column order as opposed to just the column name.

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

No branches or pull requests

2 participants