Say Cheese!

I’m trying out a solarcan, which is a pinhole camera. Attached firmly to a structure and left exposed, it should trace the trail the sun leaves across the horizon each day. I’m starting near solstice, so I should have an every higher track as we head through Winter and into Spring. I’m thinking of leaving it up for 6 months.

Aluminum beverage can attached to a wood post.

For me, this is reminiscent of Clayton Bailey‘s piece that featured a magnifying glass that burns a similar streak across a piece of wood. (Sorry I can’t find a pic.) I really admired that but was unwilling to set that up in my backyard.

Posted in Art, Astronomy, DatViz | 1 Comment

How I did a 3d Scatter Graph

I had some data where each item had three attributes. I wondered if some could be related or colletated. I thought plotting the three attributes in three dimensions may show something interesting. My current tools couldn’t do it, I was curious about Python, so I decided to give Python a try. The following are my notes in case I need to travel that road again, or to help someone else.

Step 1. Install Jupyter. I’d tried Python before, but was intrigued by the ability of Jupyter to combine other things besides code in the final product – an electronic notebook. In this case, I really wanted to document what I’d done, so I may do it later. I read that the Anaconda version has an easier user interface, So I went that way, reading up on how to install Anaconda (pretty straight forward) then downloaded and installed Anaconda (Windows). I also allowed it to update.

Step 2. I reviewed Getting Started with Anaconda Navigator.

Step 3. I did a quick check in Jupyter with the code “2+2” and ran it. I got “4”, so that seemed good. I ran that code later, and it did not work, so I restarted the kernal and all was well.

Step 4. Python does many things, but needs help to do a 3d scatter graph. I found several different plotting “libraries”, but Plotly was supposed to be good for 3D. I used some more help to install Plotly on Anaconda.

Step 5. I was still a bit mystified about installing Plotly in Anaconda, but figured out to create my first “enviroment” in Anconda, and then I added Plotly to the environment.

Step 5. The next day I had to find where I left off. Doing a search for Jupyter opened a somewhat mysterious window with things happening but also a web page with my file listed. I clicked on the file’s hyperlink and was back in business.

Step 6. I needed some test data and used Notetab to create a simple table and saved it as a CSV,

Location,MS,At,Str
Store1,30%,14,4
Store2,20%,30,3
Store3,18%.35,2
Store4,25%,32,3
Store5,10%,31,

Step 7. Importing the table data into Python. I used the instructions using Pandas. Panda is library that helps Python work with data sets.

Here’s the rest of what I did in the Jupyter notebook,

First we install Pandas and call it “pd”.

import pandas as pd

Then we create code that will find the csv file on my PC desktop. It will then import the csv and call it “spreadsheet”,

"spreadsheet = pd.read_csv('/Users/<redacted>/Desktop/john/JohnArtandProjects/3D_Python_Jupyter/5StoreExample.csv')

I wanted to check the import went okay by displaying the table with header,

spreadsheet.head()

This give us a nice little table with the headers, row numbers, and data. It looked like the csv, so we are okay.

I then import the Plotly Express library, which is supposed to allow for higher level commands that make 3D scatter graphs easier to set up,

import plotly.express as px

Plotly Express uses a data frame to hold the data, so I set the spreadsheet to “df”,

df=spreadsheet

I configured the figure “fig” to use “px” (Plotly Express’s) 3d scatter graph service and chose which colum would be represented by which axis, or color,

fig = px.scatter_3d(df, x='MS', y='At', z='Str',
              color='Location')

Finally, I asked for the figure “fig” to be drawn,

fig.show()

And I have a nice little 3D scatter graph,

Gray walls and floow with 5 colored dots and a legend of color and Stores

Next stop may be to play around with a bit of formatting titles and such, then find a way to include the code on my site so the graph is interactive.

It turns out the data I orginally was going to use was incomplete, so I will not be using it. However, I figure the above would have helped me out, so I’m putting it out there for others. If folks have more ideas, including suggestions about doing a better job, feel free to reach out in the comments.

Posted in DatViz | Tagged | Leave a comment

Monthly excess mortality across Oregon counties, a cartogram.

Science Advances recently published a paper, “Monthly excess mortality across counties in the United States during the COVID-19 pandemic“, Eugenio Paglino et al, that looked at the number of deaths that were more than expected before and during COVID. From the paper,

Between the first and second years of the pandemic, relative excess mortality decreased in large metros and increased in nonmetro areas. The increases in excess mortality in nonmetro areas occurred most markedly during the Delta wave of the pandemic. 

Monthly excess mortality across counties in the United States during the COVID-19 pandemic

The paper included county level data and charts. I was interested in applying my Oregon cartogram experiment to see any patterns. (The paper was published by Science Advance with copyleft permissions.)

Below is a too-small screen shot, as it is really meant to be views as a web page of the cartogram.

Small picture of the linked to web page,  cartogram with multiple small graphs near the counties of Oregon

Caveat: This data viz is not a thing of beauty, nor the html/CSS to be proud of, but it was the quickest way I knew how to look at the data in this way. Be careful of the y-axis changes, but to me the interest really lies in how the excess deaths ebbed and flowed over time and not so much the amount.

Posted in DatViz, Medical Informatics, Uncategorized | Tagged , , | Leave a comment

The Aphorist of NE Lloyd Blvd, Portland.

Graffiti "What would ChatGPTDo?" on service box cover attached to street post.
Posted in Art, Microblog | Leave a comment

I enjoyed the variety of thought in the Daily Nous group post under this title. I found Luke Stark’s “ChatGPT is Mickey Mouse” a particularly helpful way to understand LLM’s. Animated characters certainly act intelligent, and may affects us as if they were, but we know they are not.

Posted on by John | Leave a comment