map DataFrame index and forward fill nan values

Published: 14/01/2019
map DataFrame index and forward fill nan values
Source: STACKOVERFLOW.COM

I have a DataFrame with integer indexes that are missing some values (i.e. not equally spaced), I want to create a new DataFrame with equally spaced index values and forward fill column values. Below is a simple example: have import pandas as pd df = pd.DataFrame(['A', 'B', 'C'], index=[0, 2, 4]) 0 0 A 2 B 4 C want to use above and create: 0 0 A 1 A 2 B 3 B 4 C

Read more
Related news
Comment
FACEBOOK