Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3306202
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:15:38+00:00 2026-05-17T21:15:38+00:00

Given some data of shape 20×45, where each row is a separate data set,

  • 0

Given some data of shape 20×45, where each row is a separate data set, say 20 different sine curves with 45 data points each, how would I go about getting the same data, but with shape 20×100?

In other words, I have some data A of shape 20×45, and some data B of length 20×100, and I would like to have A be of shape 20×100 so I can compare them better.

This is for Python and Numpy/Scipy.

I assume it can be done with splines, so I am looking for a simple example, maybe just 2×10 to 2×20 or something, where each row is just a line, to demonstrate the solution.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T21:15:39+00:00Added an answer on May 17, 2026 at 9:15 pm

    Ubuntu beat me to it while I was typing this example, but his example just uses linear interpolation, which can be more easily done with numpy.interpolate… (The difference is only a keyword argument in scipy.interpolate.interp1d, however).

    I figured I’d include my example, as it shows using scipy.interpolate.interp1d with a cubic spline…

    import numpy as np
    import scipy as sp
    import scipy.interpolate
    import matplotlib.pyplot as plt
    
    # Generate some random data
    y = (np.random.random(10) - 0.5).cumsum()
    x = np.arange(y.size)
    
    # Interpolate the data using a cubic spline to "new_length" samples
    new_length = 50
    new_x = np.linspace(x.min(), x.max(), new_length)
    new_y = sp.interpolate.interp1d(x, y, kind='cubic')(new_x)
    
    # Plot the results
    plt.figure()
    plt.subplot(2,1,1)
    plt.plot(x, y, 'bo-')
    plt.title('Using 1D Cubic Spline Interpolation')
    
    plt.subplot(2,1,2)
    plt.plot(new_x, new_y, 'ro-')
    
    plt.show()
    

    alt text

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to run a set of methods given some data. I was
Say I had some data, for which I want to fit a parametrized model
I've been given 6 bits of information to access some data from a website:
Given some JS code like that one here: for (var i = 0; i
I've been given some code with commenting unlike anything I've come across before: //{{{
I was looking into sorting tables by a column designated given some input, and
Given the key for some registry value (e.g. HKEY_LOCAL_MACHINE\blah\blah\blah\foo) how can I: Safely determine
Given a pointer to some variable.. is there a way to check whether it
Given a bitmap image with some blots of solid color on it, what algorithm
Given an instance of some class in Python, it would be useful to be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.