On Sat, May 12, 2018 at 2:25 PM, kirby urner <kirby.ur...@gmail.com> wrote:
> https://github.com/4dsolutions/Python5/blob/master/Generating%20the%20FCC. > ipynb > > Next challenge is to segment the dataframe vertically, into nucleus (1) > plus successive layers (12, 42, 92...). > > Kirby > > Done! #%% # hierarchical row levels arrays = [['layer0'] + ['layer1'] * 12 + ['layer2'] * 42, range(1 + 12 + 42)] tuples = list(zip(*arrays)) rowindex = pd.MultiIndex.from_tuples(tuples, names=['Shell', 'Ball']) #%% Those weird %% thingys are I-Python / Spyder's way of letting run down a script in discrete chunks. To give a sense of the data: Vtype ivm xyz Coords a b c d x y z Shell Ball layer0 0 0 0 0 0 0.000 0.000 0.000 layer1 1 0 1 1 2 0.000 -0.707 -0.707 2 0 1 2 1 -0.707 0.000 -0.707 3 0 2 1 1 -0.707 -0.707 0.000 4 1 0 1 2 0.707 0.000 -0.707 Sharing this JN out to Facebook on math teacher group: https://www.facebook.com/groups/147158235484661/ Great for anyone into linear algebra at all. Kirby
_______________________________________________ Edu-sig mailing list Edu-sig@python.org https://mail.python.org/mailman/listinfo/edu-sig