If X is your dataframe, try using the .astype
method to convert to float when running the model:
est = sm.OLS(y, X.astype(float)).fit()
Related Posts:
- ValueError: Unknown label type: ‘continuous’
- How to fix IndexError: invalid index to scalar variable
- Convert pandas dataframe to NumPy array
- ImportError: Missing required dependencies [‘numpy’]
- Python Pandas – Missing required dependencies [‘numpy’] 1
- ‘DataFrame’ object has no attribute ‘sort’
- ‘DataFrame’ object has no attribute ‘sort’
- TypeError: cannot unpack non-iterable int objec
- ‘DataFrame’ object has no attribute ‘sort’
- What is dtype(‘O’), in pandas?
- What is dtype(‘O’), in pandas?
- TypeError: ‘DataFrame’ object is not callable
- ValueError: ‘object too deep for desired array’
- What does axis in pandas mean?
- How to take column-slices of dataframe in pandas
- Normalize data in pandas
- How to iterate over columns of pandas dataframe to run regression
- Creating a Pandas DataFrame from a Numpy array: How do I specify the index column and column headers?
- pandas create new column based on values from other columns / apply a function of multiple columns, row-wise
- Coalesce values from 2 columns into a single column in a pandas dataframe
- Concat DataFrame Reindexing only valid with uniquely valued Index objects
- Replacing Pandas or Numpy Nan with a None to use with MysqlDB
- Difference between data type ‘datetime64[ns]’ and ‘
- Merging two DataFrames
- Calculate weighted average using a pandas/dataframe
- vectorize conditional assignment in pandas dataframe
- ImportError: DLL load failed: The specified module could not be found
- Constructing pandas DataFrame from values in variables gives “ValueError: If using all scalar values, you must pass an index”
- Truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()
- Writing a pandas DataFrame to CSV file
- TypeError: unhashable type: ‘numpy.ndarray’
- ImportError: No module named pandas
- data type not understood
- Plotting a 2D heatmap with Matplotlib
- Creating an empty Pandas DataFrame, then filling it?
- What does numpy.random.seed(0) do?
- Python Pandas Counting the Occurrences of a Specific value
- What does the c underscore expression `c_` do exactly?
- Count unique values per groups with Pandas
- DataFrame constructor not properly called
- Convert pandas Series to DataFrame
- Error: all the input array dimensions except for the concatenation axis must match exactly
- How to iterate over rows in a DataFrame in Pandas
- Pandas: ValueError: cannot convert float NaN to integer
- How to find all occurrences of an element in a list
- TypeError: ‘numpy.float64’ object is not callable
- TypeError: ‘numpy.float64’ object is not callable
- ValueError: Length of values does not match length of index | Pandas DataFrame.unique()
- Convert a tensor to numpy array in Tensorflow?
- pandas: merge (join) two data frames on multiple columns
- filename.whl is not a supported wheel on this platform
- Convert a tensor to numpy array in Tensorflow?
- How to customize a scatter matrix to see all titles?
- How can I upgrade NumPy?
- How can the Euclidean distance be calculated with NumPy?
- How to get element-wise matrix multiplication (Hadamard product) in numpy?
- ValueError: could not broadcast input array from shape (224,224,3) into shape (224,224)
- Overflow Error in Python’s numpy.exp function
- Purpose of `numpy.log1p( )`?
- Pytorch tensor to numpy array
- ‘numpy.float64’ object is not iterable
- Group by index + column in pandas
- Can’t broadcast input array from shape (3,1) into shape (3,)
- Convert a Pandas DataFrame to a dictionary
- deleting rows in numpy array
- Create a Pandas Dataframe by appending one row at a time
- How to normalize a 2-dimensional numpy array in python less verbose?
- Count unique values using pandas groupby
- How can I remove Nan from list Python/NumPy
- No numeric types to aggregate – change in groupby() behaviour?
- Pandas OR statement ending in series contains
- TypeError: Invalid dimensions for image data when plotting array with imshow()
- How to get a value from a cell of a dataframe?
- Pandas split DataFrame by column value
- Using numpy to build an array of all combinations of two arrays
- Can’t update to numpy 1.13 with anaconda?
- TypeError: only integer arrays with one element can be converted to an index 3
- Pandas – Drop function error (label not contained in axis)
- LinAlgError: Last 2 dimensions of the array must be square
- Python 3: Multiply a vector by a matrix without NumPy
- datetime to string with series in pandas
- How to add a new row to an empty numpy array
- Find the unique values in a column and then sort them
- pandas groupby sort within groups
- Numpy – add row to array
- if else function in pandas dataframe
- Read data (.dat file) with Pandas
- Is there any numpy group by function?
- Boolean Series key will be reindexed to match DataFrame index
- Mean Squared Error in Numpy?
- Is there a head and tail method for Numpy array?
- pandas: multiple conditions while indexing data frame – unexpected behavior
- How to print a specific row of a pandas DataFrame?
- Logical operators for Boolean indexing in Pandas
- Transposing a 1D NumPy array
- numpy.float64 object is not iterable…but I’m NOT trying to
- How to update Pandas from Anaconda and is it possible to use eclipse with this last
- Python OpenCV2 (cv2) wrapper to get image size?
- Compare two columns using pandas
- alueError: ordinal must be >= 1