levels

Python Perform Custom Calculations on 0 level columns

Python Perform Custom Calculations on 0 level columns Question: I have a Data Frame: import pandas as pd df = pd.DataFrame({ (‘A’, ‘a’): [1, 2, 3], (‘A’, ‘b’): [4, 5, 6], (‘B’, ‘a’): [7, 8, 9], (‘B’, ‘b’): [10, 11, 12], }) df I would like to perform a defined calculation on each of the …

Total answers: 3

Counting depth or the deepest level a nested list goes to

Counting depth or the deepest level a nested list goes to Question: A have a real problem (and a headache) with an assignment… I’m in an introductory programming class, and I have to write a function that, given a list, will return the “maximum” depth it goes to… For example: [1,2,3] will return 1, [1,[2,3]] …

Total answers: 14