Questions tagged [resampling]

Resampling is any of a variety of methods for estimating the precision of sample statistics by jackknifing or bootstrapping. In it also used to validating models by using random subsets (bootstrapping, cross validation).

From Wiki

In statistics, resampling is any of a variety of methods for doing one of the following:

Estimating the precision of sample statistics (medians, variances, percentiles) by using subsets of available data (jackknifing) or drawing randomly with replacement from a set of data points (bootstrapping)

Exchanging labels on data points when performing significance tests (permutation tests, also called exact tests, randomization tests, or re-randomization tests)

Validating models by using random subsets (bootstrapping, cross validation)

Common resampling techniques include bootstrapping, jackknifing and permutation tests.

983 questions
15
votes
4 answers

Resample xarray object to lower resolution spatially

Use xarray to resample to lower spatial resolution I want to resample my xarray object to a lower spatial resolution (LESS PIXELS). import pandas as pd import numpy as np import xarray as xr time =…
Tommy Lees
  • 1,293
  • 3
  • 14
  • 34
15
votes
1 answer

How to bootstrap respecting within-subject information?

This is the first time I post to this forum, and I want to say from the start I am not a skilled programmer. So please let me know if the question or code were unclear! I am trying to get the 95% confidence interval (CI) for an interaction (that is…
Sol
  • 724
  • 1
  • 5
  • 18
15
votes
1 answer

Resample a time series with the index of another time series

I have 2 data frames with identical columns but different datetime indices. I want to resample one of them to use the index of the other and forward fill data from the one on any dates in the index of the other in which there wasn't data…
piRSquared
  • 285,575
  • 57
  • 475
  • 624
14
votes
7 answers

HTML5 canvas: is there a way to resize image with "nearest neighbour" resampling?

I have some JS that makes some manipulations with images. I want to have pixelart-like graphics, so I had to enlarge original images in graphics editor. But I think it'd be good idea to make all the manipulations with the small image and then…
ABTOMAT
  • 772
  • 4
  • 9
  • 20
14
votes
1 answer

Resampling Error : cannot reindex a non-unique index with a method or limit

I am using Pandas to structure and process Data. I have here a DataFrame with dates as index, Id and bitrate. I want to group my Data by Id and resample, at the same time, timedates which are relative to every Id, and finally keep the bitrate…
Arij SEDIRI
  • 2,088
  • 7
  • 25
  • 43
13
votes
4 answers

Panda Dataframe Resampling based on column criteria

I want to resample a dataframe if cell in another column matches my criteria df = pd.DataFrame({ 'timestamp': [ '2013-03-01 08:01:00', '2013-03-01 08:02:00', '2013-03-01 08:03:00', '2013-03-01 08:04:00', …
yusica
  • 255
  • 2
  • 5
  • 13
13
votes
1 answer

Is there a way to prevent dtype from changing from Int64 to float64 when reindexing/upsampling a time-series?

I am using pandas 0.17.0 and have a df similar to this one: df.head() Out[339]: A B C DATE_TIME 2016-10-08 13:57:00 in 5.61 1 2016-10-08 14:02:00 in 8.05 1 2016-10-08 14:07:00 in 7.92 …
vera
  • 297
  • 3
  • 11
12
votes
1 answer

Library for audio resampling

In an embedded (Windows CE) C++ project, I have to resample an arbitrary sample-rate down (or up) to 44100 Hz. Is there a free and portable C/C++ library for audio resampling?
lornova
  • 6,667
  • 9
  • 47
  • 74
12
votes
3 answers

Pandas TimeSeries resample produces NaNs

I am resampling a Pandas TimeSeries. The timeseries consist of binary values (it is a categorical variable) with no missing values, but after resampling NaNs appear. How is this possible? I can't post any example data here since it is sensitive…
Peter Lenaers
  • 419
  • 3
  • 8
  • 17
12
votes
1 answer

Pandas resample by first day in my data

I have a Yahoo finance daily stock price imported in a pandas dataframe. I want to use .resample() to convert it to the monthly stock price by taking the price of the first QUOTED daily price of each month. .resample('MS', how='first') returns the…
Amin
  • 1,883
  • 4
  • 17
  • 22
11
votes
2 answers

Scipy interpolation how to resize/resample 3x3 matrix to 5x5?

EDIT: Paul has solved this one below. Thanks! I'm trying to resample (upscale) a 3x3 matrix to 5x5, filling in the intermediate points with either interpolate.interp2d or interpolate.RectBivariateSpline (or whatever works). If there's a simple,…
moski
  • 279
  • 1
  • 4
  • 10
11
votes
2 answers

How can I add rows for all dates between two columns?

import pandas as pd mydata = [{'ID' : '10', 'Entry Date': '10/10/2016', 'Exit Date': '15/10/2016'}, {'ID' : '20', 'Entry Date': '10/10/2016', 'Exit Date': '18/10/2016'}] mydata2 = [{'ID': '10', 'Entry Date': '10/10/2016', 'Exit Date':…
Colin O'Brien
  • 2,175
  • 5
  • 20
  • 26
11
votes
3 answers

Resample in a rolling window using pandas

Assume I have daily data (not regularly spaced), I want to compute for each month the moving standard deviation (or an arbitrarily non linear function) in the past 5 months. For example, for May 2012 I would compute the stddev from the period…
Mannaggia
  • 4,559
  • 12
  • 34
  • 47
11
votes
1 answer

nvidia driver differences 275.50 and 280.19 for GTX480 GPU in opencl resampling

the resampling of an image with driver version 275.50 and 280.19 for Nvidia GTX480 GPU gives little changes in the gray values. Maybe it is an interpolation issue. I can not determine what has changed in the new version except for the implementation…
user1768352
  • 127
  • 2
11
votes
5 answers

What is the name of this algorithm, and how does it compare to other image resampling algorithms?

This algorithm has been in my mind for a long time, but I cannot find it described anywhere. It's so simple though that I can't be the only one who has thought of it. Here's how it works: You start with an image. Say, 7x7px: You need to resample it…
Vilx-
  • 104,512
  • 87
  • 279
  • 422
1
2
3
65 66