-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dataframe with 64000 rows is being processed twice #265
Comments
The example doesn't work if you don't have access to the Newton Raphson CSVs. |
|
I reduced your code sample to the following: import pandas as pd
from pandarallel import pandarallel
from spatialmath import SE3
# from Master10 import Master10DH
def ik(row):
# robot = Master10DH()
TEP = (SE3([row['x'], row['y'], row['z']]) * SE3.RPY([row['r'], row['p'], row['w']], unit="deg"))
return True, "Reason"
# sol1 = robot.ikine_NR(Tep)
# return (sol1.success, sol1.reason)
pandarallel.initialize(progress_bar=True, nb_workers=8)
df = pd.read_csv("data_300.csv")
try:
df[['solution', 'reason']] = df.parallel_apply(ik, axis=1)
except ValueError:
print("ValueError")
df['solution'] = df.parallel_apply(ik, axis=1)
Upon inspection, it seems that if we DON'T use pandarallel, the code still runs twice. It seems like you can fix your code by replacing This is not a problem with pandarallel. Unless there is other information that suggests otherwise, this issue can be closed. |
General
Bug description
The issue with pandarallel where a dataframe with 64000 rows is being processed twice can be described as follows:
Description:
When using pandarallel to apply a function to a large dataframe with 64000 rows, the dataframe is processed twice instead of once. This results in redundant computation and potentially incorrect output.
The dataframe is processed twice.
Minimal but working code sample to ease bug fix for
pandarallel
teamThe text was updated successfully, but these errors were encountered: