Re: recent wheel spinning... (spatial geom)

kirby urner <[email protected]>
Newsgroups gmane.comp.python.education
Message-ID <CAPJgG3Qmd4UHWg4W0q2th88q-omO=BEMigLZGYMO0BRU6MLRvQ@mail.gmail.com>
>
>
>
> [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

_______________________________________________
Edu-sig mailing list
[email protected]
https://mail.python.org/mailman/listinfo/edu-sig
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.