[SciPy-User] pandas data frame building by outer join

Fabrizio Pollastri f.pollastri@inrim...
Thu Dec 23 09:43:28 CST 2010


A pandas question:
it is possible to build a data frame from several time series, starting with an
empty data frame and reading the time series one at a time from a file and
joining them in outer mode to the data frame? How I can control the column name
of each added time series?

Here is a coding example, not working since join wants two data frames.

from pandas import *
from pandas.io.parsers import parseCSV
import sys

global_df = DataFrame()

for fname in sys.argv[1:]:
    current_time_series = parseCSV(fname)['col_of_interest']
    global_df = global_df.join(current_time_series,how='outer')

Fabrizio Pollastri

More information about the SciPy-User mailing list