[Solved] Comparing multiple data frames

Here are a couple of ideas. This is what I think your data look like? before <- data.frame(val=c(11330,2721,52438,6124), lab=c(“STAT1″,”STAT2″,”STAT3″,”SUZY”)) after <- data.frame(val=c(17401,3462,0,72), lab=c(“STAT1″,”STAT2″,”STAT3″,”SUZY”)) Combine them into a single data frame with a period variable: combined <- rbind(data.frame(before,period=”before”), data.frame(after,period=”after”)) Reformat to a matrix and plot with (base R) dotchart: library(reshape2) m <- acast(combined,lab~period,value.var=”val”) dotchart(m) Plot with … Read more

[Solved] Reading A Fixed Format Text File – Part 3

You have not initialized MyDataTable by a data after instantiation, you have filled in data set but not a data table. So just try out MyDataSet.Tables[0] instead of MyDataTable.AsEnumerable() // DataSet filled in but data table still empty! MyDataAdapter.Fill(MyDataSet,”STUFF”); 1 solved Reading A Fixed Format Text File – Part 3

[Solved] Is there way to replace ranged data (eg 18-25) by its mean in a dataframe?

There are several ways to transform this variable. In the picture I see, that there are not only bins, but also value ’55+’, it needs to be considered. 1) One liner: df[‘age’].apply(lambda x: np.mean([int(x.split(‘-‘)[0]), int(x.split(‘-‘)[1])]) if ‘+’ not in x else x[:-1]) It checks whether the value contains ‘+’ (like 55+), if yes than the … Read more