Skip to content
Advertisement

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

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

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].

Advertisement