Questions tagged [resample]
70 questions
1
vote
1 answer
Pandas resample with multiindex start- and enddate
Suppose I have a multi-index Pandas data frame with two index levels: month_begin and month_end
import pandas as pd
multi_index = pd.MultiIndex.from_tuples([("2022-03-01", "2022-03-31"),
("2022-04-01",…

W. Walter
- 337
- 1
- 10
1
vote
1 answer
resample dataframe and divide values over new sample frequency
How do I upsample a dataframe using resample() to get the initial values divided over the new sample frequency?
Dataframe with monthly sample frequency
date revenue
0 2021-11-01 00:00:00+00:00 300
1 2021-10-01…

normal_human
- 165
- 9
1
vote
3 answers
AttributeError: 'NoneType' object has no attribute 'split' SMOTE
I'm resampling some data using SMOTE and getting an error like this:
AttributeError: 'NoneType' object has no attribute 'split'
my code :
sm = SMOTE(random_state = 42)
X_train_resampled, y_train_resampled = sm.fit_resample(X_train_final,…

Muhammad Arkaan Ah'naf
- 11
- 1
- 3
1
vote
1 answer
Resampling or backfilling for a Pandas MultiIndex (to higher freq)
I would like to modify a dataframe of hourly stock prices that has a datetime column with hourly frequencies and missing values. Below is a min example:
date_times =['2020-12-30 14:30:00+00:00', '2022-03-20 20:00:00+00:00' ]
prices =[25.60, 21.40 …

Niccola Tartaglia
- 1,537
- 2
- 26
- 40
1
vote
1 answer
How to use gdal.Wrap() to resample a raster with nan cell
I used gdal.Wrap() to resample from a high resolution to a lower. However, my raster has no value (nan). So, when I set resampleAlg, the larger grids with nan(s) will become nan.
Here is my reprex in Python:
from osgeo import gdal
### resample and…

Chao Li
- 11
- 3
0
votes
0 answers
Does the OS resamples the audio player output to fit in specs if they're same?
If I have the sound card configured for 32-bit floating point sample size with a sample rate of 96kHz, and the audio player (vlc or ffmpeg for the case) is playing a WAV with the same configuration of the sound card, does the operating system…

Nayara
- 1
0
votes
1 answer
python pandas resample how to let last fill last null value?
I have a time series like below,
ts
Out[20]:
time
2023-08-01 10:31:40.110 6.22
2023-08-01 10:31:43.110 6.23
2023-08-01 10:31:46.111 6.23
2023-08-01 10:31:49.111 6.24
2023-08-01 10:31:52.111 6.24
2023-08-01 10:31:55.117 …

tesla1060
- 2,621
- 6
- 31
- 43
0
votes
1 answer
Python Resample 2d Numpy with interpolation
Given a 2d array of size (width=x, height=y), where each row contains entries with a height information in meters each. The distance in meters between two horizontally neighbored entries in a row varies by y-position. Thus in one row the distance…

Carsten Drösser
- 496
- 1
- 4
- 16
0
votes
1 answer
Changing value of Rational Resampler block in real time
I wanted to change Decimation value of Rational Resampler Block in real time. Tried to use QT GUI Range Block, but failed. It's possible with Range Block? Maybe somebody know how to resolve changing Decimation value in real time using another way?

Vasil992
- 3
- 1
0
votes
0 answers
Is there a way that you are able to pull in an rendered image from blender and resize/resample it using Python?
I am needing to pull a 200m square image with something that I build in blender and resample it using python. Main goal is to change the pixel size of the image.
Any suggestions on what to even write in python?
Thanks.
I am not sure how to resample…
0
votes
1 answer
Resample/Slice Pandas Timeseries/Dataframe by minimum timedelta
I have a pandas dataframe or series with timestamps at irregular intervals. I want to filter the table so that between 2 rows the minimum distance of for example 20ms is kept. The distance may also be larger. Here is an example table on the left and…

Simon
- 1
0
votes
0 answers
resample or groupby dates/hours problem results
I have a 1 minute OHLCV historical series that starts every day at 09:00 and ends at 17:54, only business days, which needs to be grouped into another frequencies.
But if I run resample or groupby, the result in some frequencies changes the start…

Denier Pardon
- 1
- 1
0
votes
0 answers
How does the sklearn resample algorithm work for upsampling?
can anybody explain, how the upsample procedure works? Are the new values only copies of the other values? I need an explanation for a presentation.
Thank you.
I read the docs, but there is not enough information to understand the algorithm.
The…

usta
- 11
- 2
0
votes
0 answers
How to save mlr3 resample object results to disk
Has anyone an efficient way to serialize and save the R6 class objects produced by the resample() function in the mlr3 package? Using saveRDS() doesn't seem to work as it takes forever. Googling suggested that serialization of the R6 objects in the…

Yodi
- 1
0
votes
0 answers
Pandas DataFrame resampling on a depth/length column
I have some depth-based geological data in pandas data frames, organised by drill hole name, depth from, and depth to, like this:
DDH_name
From_ft
To_ft
ALT1
0
A-7CD5
0.0
90.0
20
1
A-7CD5
90.0
110.0
70
3
A-7CD5
110.0
150.0
7
I also…

GlenB
- 1
- 1