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

Here's a fictional scenario with some populated data. For tax purposes, my fictional company
I have created an Excel Sheet that does some lookups to format data that
I'm trying to insert some data into a local MySQL database by using MySQL
Is it possible to Post some data from window based app to a web-server
Greetings, How can I simply encode some binary data into an ASN.1 DER-encoded blob?
I need to find out in what country given GPS coordinates are, on a
I developed a web site using rails 2.3.8, and a IM server using openfire(java).
I have written a code that maps to a shared memory location,so that the
I am making a desktop application in C#, Visual Studio 2010 on Windows XP
I know that there are similar questions which are already answered, but I am

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.