Skip to content

Tag: pandas

interpolation of missing values not NA

I want to interpolate (linear interpolation) data. but not indicated NA. Here is my data. timestamp id strength 1383260400000 10 0.007802251505435157 1383260400000 11 0.0050101566841440105 1383260400000 47 0.09910993935546883 1383260400000 48 0.16302926693340128 and expected data is : timestamp id strength 13…

Grouping python dataframe by multiple column name

My goal in to split python dataframe by multiple columns. In the case of one column, data frame can be splitted by column ‘X1’ as below, using the groupby method. However, how to split dataframe according to columns X1 and X2? Answer If pass another column name is necessary select dfs by tuples: I…

Downsample non timeseries pandas dataframe

I have a data frame like below, I want to reduce the size of data frame by Depth_Feet column (let’s say every 2 feet). Desired output is I have tried few options like round and group by etc, but I’m not able to get the result I want. Answer If need each 2 rows per groups: If need resample by