Questions tagged [interpolation]

Anything related to function interpolation, i.e. the mathematical techniques for estimating the (unknown) value of a function in a point on the basis of a set of known values in other (usually nearby) points. For interpolation of strings, see the [string-interpolation] tag.

Anything related to function interpolation, i.e. the mathematical techniques for estimating the (unknown) value of a function in a point on the basis of a set of known values in other (usually nearby) points.

See Wikipedia on interpolation.

In scientific software for statistical computing and graphics, function approx implements linear interpolation and function spline implements cubic spline interpolation.

For interpolation of strings, see .

5155 questions
31
votes
4 answers

Speedup scipy griddata for multiple interpolations between two irregular grids

I have several values that are defined on the same irregular grid (x, y, z) that I want to interpolate onto a new grid (x1, y1, z1). i.e., I have f(x, y, z), g(x, y, z), h(x, y, z) and I want to calculate f(x1, y1, z1), g(x1, y1, z1), h(x1, y1, z1).…
s_haskey
  • 519
  • 1
  • 5
  • 9
31
votes
1 answer

Create array in loop from number of arguments

#!/bin/bash COUNTER=$# until [ $COUNTER -eq 0 ]; do args[$COUNTER]=\$$COUNTER let COUNTER-=1 done echo ${args[@]} When i run this, I get the following results user@host:~/sandbox# ./script.sh first second third $1 $2 $3 and i'm expecting it to…
parsecpython
  • 585
  • 2
  • 6
  • 17
30
votes
4 answers

Resample time series in pandas to a weekly interval

How do I resample a time series in pandas to a weekly frequency where the weeks start on an arbitrary day? I see that there's an optional keyword base but it only works for intervals shorter than a day.
2daaa
  • 2,788
  • 7
  • 33
  • 44
29
votes
1 answer

How can I convert a list to a string in Terraform?

join works BUT i want to keep the double quotes join gives me this [ben,linda,john] BUT i want this ["ben", "linda", "john"] this is getting crazy, spent over 2 hours trying to fix this i want to pass in a list as a string variable why can't…
uberrebu
  • 3,597
  • 9
  • 38
  • 73
29
votes
6 answers

Interpolation over an irregular grid

So, I have three numpy arrays which store latitude, longitude, and some property value on a grid -- that is, I have LAT(y,x), LON(y,x), and, say temperature T(y,x), for some limits of x and y. The grid isn't necessarily regular -- in fact, it's…
user391045
  • 353
  • 2
  • 4
  • 6
28
votes
2 answers

D3.js binding an object to data and appending for each key

I'm a D3.js newbie and I'm learning how to play around with data. Let's say I have an object with names as keys, and each key has an array of numbers like this: var userdata = { 'John' : [0, 1, 3, 9, 8, 7], 'Harry': [0, 10, 7, 1, 1, 11], …
frshca
  • 1,309
  • 2
  • 15
  • 24
27
votes
3 answers

Interpolate NA values in a data frame with na.approx

I am trying to remove NAs from my data frame by interpolation with na.approx() but can't remove all of the NAs. My data frame is a 4096x4096 with 270.15 as flag for non valid value. I need data to be continous in all points to feed a meteorological…
pacomet
  • 5,011
  • 12
  • 59
  • 111
27
votes
3 answers

Extending a Swift class with Objective-C category

Im in a situation where I need to use Objective-C category to extend a Swift class. I've done something as follows: In "SomeClass.swift": class SomeClass: NSObject { } In "SomeClass+Extension.h": #import "Project-Swift.h" @interface SomeClass…
stephen
  • 1,617
  • 3
  • 20
  • 27
26
votes
1 answer

Interpolation over regular grid in Python

I have been struggling to inteprolate the data for "empty" pixels in my 2D matrix. Basically, I understand (but not deeply) interpolation techniques such as Inverse Distance Weighting, Kriging, Bicubic etc. I dont know the starting point exactly…
Spider
  • 967
  • 3
  • 14
  • 35
25
votes
3 answers

How can you produce sharp paint results when rotating a BufferedImage?

One attempted approach was to use TexturePaint and g.fillRect() to paint the image. This however requires you to create a new TexturePaint and Rectangle2D object each time you paint an image, which isn't ideal - and doesn't help anyway. When I use…
rtheunissen
  • 7,347
  • 5
  • 34
  • 65
25
votes
5 answers

SQL Interpolated Strings

Does T-SQL support Interpolated String? Let's put up this example: SET @query = 'SELECT ' + @somevariable + ' FROM SOME_TABLE' I want to be able to do something like that: SET @query = 'SELECT {@somevariable} FROM SOME_TABLE' Thanks for the…
user7867434
25
votes
2 answers

How do I integrate two 1-D data arrays in Python?

I have two tabulated data arrays, x and y, and I don't know the function that generated the data. I want to be able to evaluate the integral of the line produced by the data at any point along the x-axis. Rather than interpolating a piecewise…
user2565770
  • 385
  • 1
  • 4
  • 8
25
votes
1 answer

Python interpolation

I have a set of data that looks like: Table-1 X1 | Y1 ------+-------- 0.1 | 0.52147 0.02 | 0.8879 0.08 | 0.901 0.11 | 1.55 0.15 | 1.82 0.152 | 1.95 Table-2 X2 | Y2 -----+------ 0.2 | 0.11 …
pear
24
votes
8 answers

How do I implement a Bézier curve in C++?

I'd like to implement a Bézier curve. I've done this in C# before, but I'm totally unfamiliar with the C++ libraries. How should I go about creating a quadratic curve? void printQuadCurve(float delta, Vector2f p0, Vector2f p1, Vector2f p2); Clearly…
Nick Bolton
  • 38,276
  • 70
  • 174
  • 242
24
votes
1 answer

How to smooth by interpolation when using pcolormesh?

I have a basemap of the world, and it's filled with data (lintrends_mean) using pcolormesh. Because the data has relatively large grid boxes, I'd like to smooth the plot. However, I can't figure out how to do this. Setting shading='gouraud' in the…
Cebbie
  • 1,741
  • 6
  • 23
  • 37