[Edu-sig] recent wheel spinning... (spatial geom)
kirby urner
kirby.urner at gmail.com
Sat May 12 17:25:35 EDT 2018
>
>
>
> [2] C6XTY @ sa: this Thursday:
> https://flic.kr/p/HnGeut
>
> (sa: is where I've taught Martian Math before)
> http://www.4dsolutions.net/satacad/martianmath/toc.html
> http://wikieducator.org/Martian_Math
>
>
In this post I'm merging two threads:
(i) introduce some of the high end 3rd party stuff early e.g. science stack
numpy and pandas
(ii) segue a geometry that requires some rethinking of familiar orthodoxies.
Example:
pd.options.display.float_format = '{:,.3f}'.format
data = pd.DataFrame(vectors, columns = index)
print(data)
Vtype ivm xyz
Coords a b c d x y z
0 0.000 1.000 1.000 2.000 0.000 -0.707 -0.707
1 1.000 0.000 1.000 2.000 0.707 0.000 -0.707
2 2.000 0.000 1.000 1.000 0.707 0.707 0.000
3 0.000 2.000 1.000 1.000 -0.707 -0.707 0.000
4 0.000 1.000 2.000 1.000 -0.707 0.000 -0.707
5 1.000 2.000 1.000 0.000 -0.707 0.000 0.707
6 1.000 1.000 2.000 0.000 -0.707 0.707 0.000
7 2.000 1.000 1.000 0.000 0.000 0.707 0.707
8 1.000 0.000 2.000 1.000 0.000 0.707 -0.707
9 1.000 2.000 0.000 1.000 0.000 -0.707 0.707
10 2.000 1.000 0.000 1.000 0.707 0.000 0.707
11 1.000 1.000 0.000 2.000 0.707 -0.707 0.000
Getting such multi-indexing requires such as:
arrays = [['ivm', 'ivm', 'ivm', 'ivm', 'xyz', 'xyz', 'xyz'],
['a', 'b', 'c', 'd', 'x', 'y', 'z',]]
tuples = list(zip(*arrays))
index = pd.MultiIndex.from_tuples(tuples, names=['Vtype', 'Coords'])
Call it business math if you like, micro-management of data tables via some
command line interface.
https://en.wikipedia.org/wiki/In_the_Beginning..._Was_the_Command_Line
That's using the multi-indexing phenomenon (object) the pandas dataframes
provide.
Above, I'm showing vectors in two notations, side by side, with a link to
their colorful depictions, in terms of ball packings, at this still
improving Jupyter Notebook:
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/edu-sig/attachments/20180512/e5f51989/attachment-0001.html>
More information about the Edu-sig
mailing list