I am new to python. I have a dataset I converted it to dataframe. all my dates are objects now. I need to convert them into dates in order to find the age of patients. My dimensions are 3400×14 long. there are date values inside which have incorrect syntax. I cannot find them. is there a way to find them?
Tag: statistics
Simulating expectation of continuous random variable
Currently I want to generate some samples to get expectation & variance of it. Given the probability density function: f(x) = {2x, 0 <= x <= 1; 0 otherwise} I already found that E(X) = 2/3, Var(X) = 1/18, my detail solution is from here https://math.stackexchange.com/questions/4430163/simulating-expectation-of-continuous-random-variable But here is what I have when simulating using python: What am I doing
How do I distribute a value between numbers in a list
I am creating a bias dice rolling simulator I want the user to: 1.Input the number they would like to change the prob of 2.Input the prob (in decimal form) Then I would like my program to distribute the remainder between the other values, this is my first post – let me know if any other info is needed My
How to generate random values for a predefined function?
I have a predefined function, for example this: How can I generate random values against it so I can plot the results of the function using matplotlib? Answer If you want to plot, don’t use random x values but rather a range. Also you should use numpy.exp that can take a vector as input and your y in the lambda
Two parameter non-linear function for modeling a 3-D surface
I’m interested in modeling this surface with a simple equation that takes in two parameters (x,y) values and produces a z value. Ideally an equation that has a simple form. I have tried Monkey Saddle, …
how to compare two columns and get the mean value of the the 3rd column for all matching items in the two in python pandas dataframe?
I have the following table named Rides : start_id end_id eta A B 5 B C 4 A C 6 A B 5 B A 3 C A 3 B C 6 C A 5 A B 8 From the Rides Table , I want to Create a new table which should look like …
Why doesn’t Johnson-SU distribution give positive skewness in scipy.stats?
The code below maps the statistical moments (mean, variance, skewness, excess kurtosis) generated by corresponding parameters (a, b, loc, scale) of the Johnson-SU distribution (johnsonsu). For the …
Python/Pandas time series correlation on values vs differences
I am familiar with Pandas Series corr function to compute the correlation between two Series, so example: import pandas as pd import numpy as np A = pd.Series(np.random.randint(1,101,50)) B = pd….
Creating vector with intervals drawn from Poisson process
I’m looking for some advice on how to implement some statistical models in Python. I’m interested in constructing a sequence of z values (z_1,z_2,z_3,…,z_n) where the number of jumps in an interval (…
Why do coefficient of determination, R², implementations produce different results?
When attempting to implement a python function for calculating the coefficient of determination, R², I noticed I got wildly different results depending on whose calculation sequence I used. The …