Python Forum
Interpolating DataFrame method=‘index’ help
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Interpolating DataFrame method=‘index’ help
Given the following:
import pandas as pd
merged = pd.DataFrame({'Z':(0,1.,2.5,3.),'X':(-1.,None,None,0),'U':(0,1.,1.,0)})

for col in merged:
    merged[col] = pd.to_numeric(merged[col], errors='coerce')

Can I interpolate my data within the DataFrame similar to the 'linear' method but get the results achieved by indexing a series? I'm losing data by making the series and don't know how to get my answer otherwise.

Do I need to take my DataFrame, break it up into Series, then turn them back into a new interpolated DataFrame?
You can set index, perform interpolation and drop the index:


Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] Getting Index Error - list index out of range krishna 2 1,056 Jan-09-2021, 08:29 AM
Last Post: buran
  Getting Index Error - list index out of range RahulSingh 2 3,421 Feb-03-2020, 07:17 AM
Last Post: RahulSingh
  How to find index of a particular value in a dataframe ankitawadhwa 0 1,556 Jan-21-2020, 09:45 PM
Last Post: ankitawadhwa
  How to add data to the categorical index of dataframe as data arrives? AlekseyPython 1 1,250 Oct-16-2019, 06:26 AM
Last Post: AlekseyPython
  Applying operation to a pandas multi index dataframe subgroup Nuovoq 1 1,510 Sep-04-2019, 10:04 PM
Last Post: Nuovoq
  How to get first and last row index of each unique names in pandas dataframe SriRajesh 1 3,215 Oct-13-2018, 07:04 AM
Last Post: perfringo
  DataFrame index issue Astrikor 2 1,822 Aug-25-2018, 04:25 PM
Last Post: Astrikor
  Newbie question to return only the index of a dataframe zydjohn 0 1,578 Jan-22-2018, 03:40 PM
Last Post: zydjohn
  is a pandas dataframe timeseries time index in a specified range (but ignoring date)? m_lotinga 4 16,540 Dec-12-2016, 10:51 PM
Last Post: m_lotinga

Forum Jump:

User Panel Messages

Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020