Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 1 year ago. Improve this question I’m looking for some advice as to how to automate commands via Terminal using a Mac. I’m using a CLI
Tag: r
Calculate Density based on Lat/Lon
I’m very sorry to say that I do not have any sample code for this question. The reason being, I’ve been looking for a way to do this and I’ve got no ideas. I’m not looking for specific code help, more like some general guidance on where to start. I have lat/lon for people living around California. Based on the
Passing arguments to a R script from a JuPyter notebook on a Mac and vice versa?
I have a JuPyter notebook (in Python), and looking to pass a list of arguments into a R program (stored separately in the same directory). After the R program is executed, it will then pass the results back to the JuPyter notebook. I am on macOS. So my questions are the following: How do I pass arguments from JuPyter (Python)
Create a matrix of pairwise comparisons between columns
I would like to create a matrix showing the number of row-wise differences for each pairwise comparison of columns. This is what I’m starting with: This is what I want to end up with: How can I do this in Python or R? Answer Try adist like below
How to adjust the numerical precision for integers
I’m trying to work with big numbers in R, in my opinion they aren’t even that big. I asked R to return me the module of the division of 6001532020609003100 by 97, I got answer 1; when doing the same calculation in Python I got answer 66. Can someone tell me what’s going on? Answer R doesn’t have the same
Can pandas perform an aggregating operation involving two columns?
Given the following dataframe, is it possible to calculate the sum of col2 and the sum of col2 + col3, in a single aggregating function? . col1 col2 col3 0 a 1 10 1 a 2 20 2 b 3 30 3 b 4 40 In R’s dplyr I would do it with a single line of summarize, and I
Recode multiple values in several columns in Python [similar to R]
I am trying to translate my R script to python. I have a survey data with several date of birth and education level columns for each family member(from family member 1 to member 10): here a sample: I had a function in R in order to check the logic and re code wrong education level in all columns.Like this and
Weibull: R vs Python – slightly different results
I’m trying to replicate R’s fitdist() results (reference, cannot modify R code) in Python using scipy.stats. The results are quite close but still different (difference is at not acceptable level). Does anybody know why the results are different? How can I reduce the difference between the results? scipy_stats.weibull_min definition (https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.weibull_min.html) seems to be the same as R’s weibull (https://stat.ethz.ch/R-manual/R-devel/library/stats/html/Weibull.html. Data
apply function of R in python
I have a code in R that works. But I want to re-do it in python. I use R to use apply function in order to calculate minor allele frequency. Can someone tell me how such a code would look in python? I am using pandas to read the data in python. I have read the file using pandas but
Error while running CNN for 1 dimensional data in R
I am trying to run 1 dimensional CNN in R using keras package. I am trying to create one-dimensional Convolutional Neural Network (CNN) architecture with the following specification But it is giving me following error Error in py_call_impl(callable, dots$args, dots$keywords) : ValueError: Negative dimension size caused by subtracting 4 from 1 for ‘conv1d_20/conv1d’ (op: ‘Conv2D’) with input shapes: [?,1,1,128], [1,4,128,256].