Skip to content

Tag: numpy

Linear regression plot on log scale in Python

I want to do linear regression to the data given by x and y. Everything seems to be fine when I use a linear plot, but when I want to plot it on a log scale the line does not look straight. I think I should divide the interval into finer grids rather than only six points. But I couldn’t

how do i remove rows from numpy array based on date?

i have a number of arrays with the following format: how do i remove the rows where the datetime > 2021-05-06 09:20 and < 2021-05-06 09:40 ? I have tried with np.delete: and np.where: but always get the error: SyntaxError: leading zeros in decimal integer literals are not permitted; use an 0o prefix for…

calculate sum of squares with rows above

I have a dataset that looks like this: I want to iterate through each row and calculate a sum of squares value for each row above (only if the Type matches). I want to put this value in the X.sq column. So for example, in the first row, there’s nothing above. So only (-1.975767 x -1.975767). In the seco…