ValueError: Shape of passed values is (6, 6), indices imply (4, 6) error when merging two df in pandas
Try changing your code from:
df5 = pd.concat([df1, linkdf], axis=1, ignore_index=True)
To
df5 = pd.concat([df1.reset_index(), linkdf], axis=1)
Gives you:
index Background Skin ... Face Head Link
0 value Beige Light Gray ... Beard Bowl Cut https://example.com
1 value Blue Normal ... Blushing Durag Red. httpsl//example2.com
Concat gives Shape of passed values is X, indices imply Y
Here's a simple way:
df['grad'] = np.gradient(df['value'], df['diff_day'])
To make your solution work, you can do:
result = pd.concat([df.reset_index(drop=True), grouped_2.reset_index(drop=True)], axis=1)
Related Topics
Python: Requests.Exceptions.Connectionerror. Max Retries Exceeded With Url
Python 2D List Performance, Without Numpy
How to Update/Delete Rows in Bigquery from the Python API
How to Insert a Checkbox in a Django Form
Tf.Data.Dataset: How to Get the Dataset Size (Number of Elements in an Epoch)
Keras + Tensorflow and Multiprocessing in Python
Vscode: There Is No Pip Installer Available in the Selected Environment
How to Install Colorama in Python
How to Repeat Each Test Multiple Times in a Py.Test Run
Loop Through Json Data in Python
How to Compare Two Image Files Contents in Python
Matplotlib Rotate Image File by X Degrees
Adding Months to a Pandas Object in Python
Pandas Concat: Valueerror: Shape of Passed Values Is Blah, Indices Imply Blah2
Replace Single Quote to Double Quote Python Pandas Dataframe
Sklearn Error Valueerror: Input Contains Nan, Infinity or a Value Too Large for Dtype('Float64')