0

I want to handle with a table of following form:

example = {'Assumptions': 1, 'Index': 5, 'Proposition': '¬p∧ ¬ (¬p)', 'Premisses': [4, 3], 'Rule': '∧I'}

The command

example = pd.DataFrame(example)

gets:

   Assumptions  Index Proposition  Premisses Rule
0            1      5  ¬p∧ ¬ (¬p)          4   ∧I
1            1      5  ¬p∧ ¬ (¬p)          3   ∧I

but my aim is to get some table of following form:

   Assumptions  Index Proposition  Premisses        Rule
0            1      5  ¬p∧ ¬ (¬p)          [3, 4]   ∧I

Is their a way to do that?

1 Answer 1

1

You could wrap it in a list first, then construct the DataFrame:

df = pd.DataFrame([example])

Output:

   Assumptions  Index Proposition Premisses Rule
0            1      5  ¬p∧ ¬ (¬p)    [4, 3]   ∧I
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.