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 9163569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T14:28:35+00:00 2026-06-17T14:28:35+00:00

I run pandas OLS on a data set. If I run it with less

  • 0

I run pandas OLS on a data set. If I run it with less than 20 time series in the x-value, everything works fine
Is there a maximum of dependants pandas.ols can handle?
This is what I’m doing, except that I have the data on file instead of fetching it with the DataReader:

from pandas import Series, DataFrame, ols
from pandas.io.data import DataReader
from DataContainer import DataContainer
import random

window = 21
basic = DataReader("BHI", "yahoo")
print len(basic)
dependance = 15

sp100 = [
            "AAPL", "ABT", "ACN", "AEP", "ALL", "AMGN", "AMZN", "APC",
            "AXP", "BA", "BAC", "BAX", "BK", "BMY", "BRK.B", "CAT", "C", "CL",
            "CMCSA", "COF", "COP", "COST", "CPB", "CSCO", "CVS", "CVX", "DD", "DELL",
            "DIS", "DOW", "DVN", "EBAY", "EMC", "EXC", "F", "FCX", "FDX", "GD", "GE",
            "GILD", "GOOG", "GS", "HAL", "HD", "HNZ", "HON", "HPQ", "IBM", "INTC",
            "JNJ", "JPM_1", "KFT", "KO", "LLY", "LMT", "LOW", "MA", "MCD", "MDT", "MET",
            "MMM", "MO", "MON", "MRK", "MS", "MSFT", "NKE", "NOV", "NSC", "NWSA",
            "NYX", "ORCL", "OXY", "PEP", "PFE", "PG", "PM", "QCOM", "RF", "RTN",
            "SBUX", "SLB", "SLE", "SO", "SPG", "T", "TGT", "TWX", "TXN", "UNH", "UPS",
            "USB", "UTX", "VZ", "WAG", "WFC", "WMB", "WMT", "XOM"
        ]

keys = random.sample(sp100, dependance)

data = {key: DataReader(key, "yahoo") for key in keys}
vals = {key: DataFrame(data=Series(data[key], name=key), index=basic.index) for key in data}
model = ols(y=basic, x=vals, window=window)

The error occurs as soon as dependance >= 20, but never for dependance <20.
The vals dict is just there cause my local datastructure gives the same name to every DataFrame, which ols doesn’t like, and I didn’t find a better way to rename the DataFrames.

  • 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-06-17T14:28:37+00:00Added an answer on June 17, 2026 at 2:28 pm

    Ok, this seemed to be a bug/feature of pandas 0.9.0 and/or statsmodels 0.4.2. Upgraded to pandas 0.10.0 and statsmodels 0.5.0 and everything works fine now.

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

Sidebar

Related Questions

I have a large time-series set of data at 30 minute intervals and trying
Can the pandas data analysis module run on Google App Engine? My first inclination
I am trying to run a Winsorized regression in pandas for Python. The very
run the following, and its supposed to return the company name. The xpath works
Run time exception-- java.lang.ClassCastingException ... Integer intArr[] = new Integer[arrList.size()]; ArrayList <Integer> arrList =new
I have been testing out pandas and pytables for some large financial data sets,
I run a WCF on IIS 7 with a load balanced server configuration. Everything
I have a DataFrame that consists of many stacked time series. The index is
I run the code gives me the following sample data md5deep find * |
Run time error Cannot find column 0. below is my code string connectiostring =

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.