The error message indicates that df2
is of type pd.Series
. You need to convert df2
.to_frame()
as .merge()
needs a pd.DataFrame()
input (see docs):
df1.merge(df2[['*.S']].to_frame(), left_on='id', right_index=True)
while you probably also just could:
df1.merge(df2.to_frame(), left_on='id', right_index=True)
Alternatively, you can use pd.DataFrame.join()
which accepts a pd.Series
.
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
- 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
- Building multi-regression model throws error: `Pandas data cast to numpy dtype of object. Check input data with np.asarray(data).`
- 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 ‘
- 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
- Pandas DataFrame Groupby two columns and get counts
- How to fix ‘Object arrays cannot be loaded when allow_pickle=False’ for imdb.load_data() function?
- TypeError: unhashable type: ‘numpy.ndarray’
- 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 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
- Ignoring NaNs with str.containsv
- 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
- import pandas_datareader gives ImportError: cannot import name ‘is_list_like’
- How to add pandas data to an existing csv file?
- What are the differences between numpy arrays and matrices? Which one should I use?
- pandas groupby sort within groups
- if else function in pandas dataframe
- cannot convert the series to
- Read data (.dat file) with Pandas
- mean, nanmean and warning: Mean of empty slice
- Is there any numpy group by function?
- How to convert index of a pandas dataframe into a column
- pandas replace multiple values one column
- Boolean Series key will be reindexed to match DataFrame index
- How to implement the ReLU function in Numpy
- 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