Monday, November 16, 2020

Tableau setting up

 Tableau setting up

 

Just a few particulars as I get started using Tableau Public:

 

1. The data for the x-axis should be put in the Column shelf, while the data for the y-axis should go in the Rows shelf. Contrary to the tutorial videos, I prefer not to just drag and drop icons on the main canvas and trust it to do the right thing.

2. Cntl or Shift select multiple measures to go in as Rows that share a common Column by dragging onto the y-axis tic mark area until you see a double short vertical bars. The legend is auto-generated and can be copied with a right mouse click context popup menu.

3.  After saving/uploading the visualization to the Tableau server, look for the "Metadata" link in the lower right corner of the webpage to see all the worksheets and dashboards listed by title. Click on the one you want. By default, Tableau always opens the Viz on the server to the last item.

4. When working in a Dashboard, look in the upper left hand corner for the "Range" and the drop down menu to the right of it. Choose "automatic" to fill your screen, which will hopefully also scale the viz to any other screen when people look at it on their own.

 5. Again in the Dashboard, click into the blank white space  subsection representing your row measure, then click on the "Color" mark button to get a simple menu of solid color choices for all of your bars in a bar chart. Otherwise, if you drag the row measure onto the button, the only color choices you'll see are all gradients.

6. To modify y-xis viewing parameters, right mouse click on the axis and then choose "Format ...". Changing the label size and font is done simultaneously with the tic mark size and font. Look for "Default" Font with a drop down menu.



 

 

 

 

 

 

 

 

 

 

Monday, November 2, 2020

SciPy Highlights

 The scipy module is based on the numpy array handlers and does a variety of statistical, parameter contour space searches for minima, special treatments of sparse matrices, interpolations and hypothesis testing.


Finding roots of an equation:


from scipy.optimize import root

from math import cos

from scipy import constants


# Note that the equation can remain generalized with no definite array for x


def eqn(x):

  return x**3 + cos(x)


myroot = root(eqn, (constants.pi/2)) # pi is a best initial guess at the root


print(myroot.x)


# results in:

# the solved for root is x. nfev is the number of evaluations of the function.

fjac: array([[-1.]])

     fun: array([1.11022302e-16])

 message: 'The solution converged.'

    nfev: 16

     qtf: array([-7.64299735e-12])

       r: array([-3.00853835])

  status: 1

 success: True

       x: array([-0.86547403])



We can also evaluate for the minimum of a function:

minimize(a, b, c, d, e)


a: the objective function

b: best initial guess

c: choice of evaluation method

d: callback - optional post-iteration function to use

e: dictionary of optional parameters


def eqn(x):

  return x**2 + x - 6


themin = minimize(eqn, 10, method='BFGS')


print(themin)


# results in:


fun: -6.249999999999978

 hess_inv: array([[0.49999999]])

      jac: array([2.98023224e-07])

  message: 'Optimization terminated successfully.'

     nfev: 8

      nit: 2

     njev: 4

   status: 0

  success: True

        x: array([-0.49999985])


If we try a cubic function though, the results are not usable.


def eqn(x):

  return x**3 + x - 6


themin = minimize(eqn, 750, method='BFGS')


print(themin)


# results in:

fun: array([-6.94927495e+08])
 hess_inv: array([[-0.00037628]])
      jac: array([2353680.])
  message: 'Desired error not necessarily achieved due to precision loss.'
     nfev: 276
      nit: 18
     njev: 132
   status: 2
  success: False
        x: array([-885.75370841])


GitHub Repositories

 

Python source file, MySQL Workbench model, EER Diagram and sample flat files and database dump file for the eBay collectible Stamp Grades Aspect Container ensemble statistics and Stamp World Region Category Container statistics.


https://github.com/DancingGuy/Stamp-Geographic-Statistics


https://github.com/DancingGuy/Stamp-Grade-Statistics