Giter Site home page Giter Site logo

Comments (3)

shermansiu avatar shermansiu commented on June 11, 2024

The example doesn't work if you don't have access to the Newton Raphson CSVs.

from pandarallel.

reinzler avatar reinzler commented on June 11, 2024

The example doesn't work if you don't have access to the Newton Raphson CSVs.

data_300.csv

from pandarallel.

shermansiu avatar shermansiu commented on June 11, 2024

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)

Master10 seems to be a custom package for operating a robot, so I've commented that code out.

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 df[['solution', 'reason']] = df.parallel_apply(ik, axis=1) with df[['solution', 'reason']] = df.parallel_apply(ik, axis=1).tolist().

This is not a problem with pandarallel. Unless there is other information that suggests otherwise, this issue can be closed.

from pandarallel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.