Data Analysis

Excel and .csv lesson learned… Includes painful waste of time, unfortunately.

Posted on

I found out that when you export data in .csv format from #Excel make sure you don’t have a trailing space after any column names. They are exported as “col_name ” with the space AND quotes. Beware when using them to index your array! They will fail. Simply delete any hidden spaces in your column names before exporting. Please. For your own sanity. #DataAnalytics #ERROR #painful lesson.

Peter Bakke DOH!

Data Analysis

Debugging Javascript – one useful tool

Posted on

Here’s an idea for displaying those pesky ephemeral variables that come and go like ghosts in JavaScript. Check this out. I
want to know if I’m reading in a CSV file properly or not. You can use for any variable / array / object.

<script>

// Read in a .csv file
d3.csv(“../datafile.csv”, function(someData) {
debugMe(someData);

});

function debugMe(whateverData) {

// ‘Sum Ages’ is a variable in row zero of passed var ‘whateverData’
document.getElementById(“debug”).innerHTML = “Debug: ” + whateverData[0][‘Sum Ages’].toString()
}

</script>

<p id=”debug”></p>

Data Analysis

Python Immutable strings, integers, booleans

Posted on

In Python, STRINGS, INTS, BOOLs etc. are IMMUTABLE… meaning, for example, that you cannot convert a df column that is a string to a column that is int.  However,  you can ASSIGN the values (objects) to another variable or create a new instance of that column in another dataframe   … or use .astype(int) to perform an intermediate computation.

python-logo-Pete-Bakke

Data Analysis

Local Host Noob Error .. Closed CMD window

Posted on

FYI all users of Windows. I discovered that my local web server stopped working when I closed my Windows CMD window. I use the following command line to start up a local web server: python -m SimpleHTTPServer.

Makes sense, I suppose, that the web server craps out when the CMD window is closed, but it took moi quite a while to figure out why my local web-served data visualization file worked one minute and I got an error the next minute (http://localhost:8000/basic_charts.html Error message: This site can’t be reached … localhost refused to connect ).

Reason: I had closed the Windows CMD window somehow, somewhere along the way!  Newbie Noob error. Oh, well. Still learning!newbie here - Peter Bakke

Moi

Do the TWIST 

Posted on
 Some of my favorite movie plot twists (I don’t want to spoil any films you may not have seen, so read with care):

North by Northwest: Grace Kelly is actually an FBI informant who is found out by bad guys (James Mason and Martin Landau). Easter egg, in the shooting scene at the Mt. Rushmore restaurant, watch the young boy in the background cover his ears just before the gunfire occurs. Priceless.

Usual Suspects: Limping runt ends up being top dog.

Marathon Man: Diamonds thrown away at end.

Spellbound: Gregory Peck killed a man. But, he didn’t do it. But, he did do it. But, he didn’t do it.

Treasure of the Sierra Madre: Gold dust blows away in wind storm at finale.

Zulu: Final scene – you think 20,000 Zulu warriors are amassing for the coup de grace, but they pay their respects to the few remaining British soldiers and leave.

Charade: 1) Cary Grant is actually a government agent. 2) Hum-drum belongings contain an envelope with 3 stamps worth $250 thousand.

The List of Adrian Messanger: 1) Lots of disguised actors is loads of fun – Frank Sinatra, Robert Mitchum, Kirk Douglas, Tony Curtis, and Burt Lancaster. 2) Final scene of a fox hunt: George C. Scott outwits Kirk Douglas – it is Douglas, while escaping, who gets impaled on tines of repositioned farm equipment.

Sixth Sense: Bruce Willis is a dead man walking.

Bedford Incident: After Navy Captain (Richard Widmark) destroys a Soviet submarine with a tactical nuke there are a few stunned seconds of silence. Then the sonarman cries out: “Incoming torpedoes!” The ship has no defenses and everyone is doomed. No winners here. The look exchanged between Widmark and Sidney Potier when they know they are about to die is chilling and one of the greatest scenes in film, IMHO.

Failsafe: Quid pro quo for blasting Moscow to eternity, President Henry Fonda gives the order to nuke New York, even though he knows his wife is there.

A Few Good Men: One of the Marines on trial did not actually hear the order for “code red” from an officer – he heard it from his Marine friend who told him about it. Devastating to the defense, it sets up a great scene between Tome Cruise and Demi Moore (“the galactically stupid”). Don’t get me wrong, I love Demi Moore in this movie – nobody ever looked so good in Navy dress whites.

12 Monkeys: Too many twists to enumerate. But here’s one: Madeline Stowe thinks everything falls into place after she makes a phone call alone in Times Square. But when she chats with Bruce Willis about it afterward, he is able to repeat word-for-word what she said in the phone conversation. He has heard a recording of the conversation (from the future) – Gotcha!

Dr. Strangelove: All the thermonuclear explosions at the ending, starting with the one in the War room. BTW (Easter egg), towards the end of the movie, watch the actor, Peter Bull, in the background breaking up laughing as actor Peter Sellers, as Dr. Stranglove, bites his own hand, trying to prevent his own arm from doing a Nazi salute.

Uncategorized

Jerome Davis : World Traveler Promotes tours for Peace

Posted on

By Betty Knosler
Lake-Sumter Sentinel
Tuesday, January 22, 1963

CLERMONT – Sociologist, educator, world traveler, (war correpondent – Ed.), and lecturer would only begin to describe Dr. Jerome Dwight Davis, winter visitor to Clermont.

Dr. Davis, born in Kyoto, Japan, of Congregationalist missionaries (Father: Jerome Dean Davis – Ed.) near the turn of the century, has also been the author of over 25 books and an international YMCA representative.

While an Oberlin College student, he decided that, although he would not enter the missionary field as did his father, who founded the largest Christian University in Japan, he would devote his life to helping people everywhere with no thought of gain.

Still a student at Union Theological Seminary, he became secretary to Sir Wilfred Grenfell as he built hospitals, schools, and churches throughout Labrador and the Maritime provinces of Canada.

DOING MOST of their traveling by small ship, they were aground three times, on fire once, lost an anchor and were also hit by a huge iceberg.

Using axes to free stateroom doors and then to free the ship from the iceberg, they continues on course.

From 1916 to 1918, at the request of Dr. John R. Mott, world head of the YMCA, Davis represented the YMCA in Russia. Beginning with prisoner of war camps for German and Austrian prisoners, he established medical, educational, religious, recreational and self-governing committees in 29 prisoner of war camps.

The improving of conditions in the POW camps eventually led to the establishment of the first YMCA for Russian soldiers in Russia. This work was accomplished while the Tsar was still in power.

DR. DAVIS, who has seen the evils of Communism through his many trips to Russia, is bitterly opposes to the Communist doctrine, and believes that the only hope of the world lies in the success of the United Nations and a genuine effort for peace.

Following World War I, he taught at Dartmouth and in the Yale University Divinity School. It was during his Yale period that he became president of the American Federation of Teachers for three years and was also president of the Eastern Sociological Society.

Dr. Davis was chairman of the legislative commission on Jails for the state of Connecticut for 12 years, during which time many reforms were instituted in the penal system.

HE ALSO founded the religion and labor foundation, now located in Washington, which was instrumental in focusing attention on the wrongs of the 12-hour day and the seven-day work week. This was abolished eight years after the foundation’s establishment.

Representing the YMCA again, from 1940 to 1943, Dr. Davis was director of YMCA work in the prisoner of war camps in all of Canada.

(In 1944, Dr. Davis was a war correspondent for the Toronto Star, stationed in Moscow – Ed.)

For the last few years Dr. Davis has devoted his time to lecturing, writing books and heading international good will tour groups each summer. These groups are composed of teachers, ministers, doctors and other professional people.

This summer, one group will go to West Africa and the Middle East and a second group will go to the Scandinavian countries, Russia, Turkestan and France.

The tours are sponsored by Promoting Enduring Peace, Inc., of which Dr. Davis is executive director. He believes that person to person contact wins friendship for the American in foreign lands.

The only way we can change the kind of world we are in is by slow, constructive change, not revolution.

On these tours, they try to prove to the people of the world that the U. S. has more to offer and can be of more assistance than can any other country or countries.

DR. DAVIS would welcome inquiries sent to either 489 Ocean Ave., West Haven, Conn., or 2025 Sunset Lane, Clermont, from anyone interested in these tours.

The latest book of Dr. Davis will be published by Citadel Press in cloth and paper editions in June. The book “World Leaders I have Known” includes stories on Sir Grenfell, Franklin D. Roosevelt, Harry Emerson Fosdick, Walter Reuther, Sidney Hillman, Djilas, who is now in a Yugoslavian prison, Kagawa of Japan and Ghandi of India.

(Text entered by Peter Bakke)

Data Analysis

Getting python.exe to run from any directory on my PC so I could use D3’s external data file load function

Posted on

The only way I could get python (python.exe) to run from any directory via from the command line was to set the SYSTEM variable PATH, *not* by changing the USER variable path. Arghhh. Took an hour of searching the Oracle (i.e., Google) to finally discover this.

Where I was headed was that I needed to steer to a local directory in the command line in order to start a local web server for using D3 …  http://localhost:8000/whatever.html. I started a local web server using  ‘python -m SimpleHTTPServer’.  Loading a local external file in D3, like:

d3.tsv("data.tsv", function(data) {
console.log(data[0].x);
});

requires a web server to be running (due to AJAX calls).

Unlike other frameworks / apps, D3 does *not* use the local machine’s OS file system to load files, it needs a web server. Who knew? Arghhh (redux).

Frustration Peter Bakke

Moi

ESPN’s NCAAM Tournament challenge

Posted on

Somehow, I’m doing better than 99.94% of other people who played ESPN’s NCAAM Tournament challenge. I picked 5 elite 8 winners and 3 final 4 picks. Go figure. (Go Kansas, all the way!) Cool, but out of 17 million brackets cast, that means I’m only ranked 6538. Ha Ha! #ESPN

NCAAM 2018 Bracket Peter Bakke

Sports

Arizona Wildcats Basketball : my 2 cents for the PAC-12 and NCAA Tournaments

Posted on

I hope the ‘real’ University of Arizona Wildcats basketball team shows up and that every player hits on all cylinders. Lonzo Trier didn’t show up in the Cal game and it really hurt. C’mon Cats… show us what you’ve got! Do not, I repeat do not EVER look at point spreads. Coaches included. Don’t look at social media or any media for the next month for krikey’s sake! Concentrate on what you do and don’t get distracted. Point spreads don’t mean crap, so don’t futz up your mind with them. You were supposed to beat Cal by 20 and look what happened. The final score was not indicative of your lousy effort for the first 35 minutes against a team with an RPI of 209. I am convinced that any Division I team can beat a top 25 team – and can do so on any given day. Look at Colorado tonight. They shot lights out against ASU. Wake up! Put the pedal to the metal for 40 minutes and play some defense for a change. All will be good if you put your heart into it. You can bet that the Buffs will be coming at you full bore today. What have they got to lose? They are playing great basketball like there is no tomorrow. Attitude wins, men. Rise up. Go Cats! Update: U of Arizona won the PAC-12 Championship. So what. They lost in the first NCAA Tournament game to Buffalo. Always next year. Go Cats (recruiting!)  :^PUniversity of Arizona Peter Bakke

Digital Marketing

Free, Effective Advice: Immediately increase engagement on your social media accounts by adding hashtag keywords

Posted on
My letter to a local business person.
I must make a strong suggestion now that can immediately increase engagement on your Twitter and LinkedIn social media accounts (actually, all social media accounts).
I see that engagement appears to be low on your accounts re: Likes, Retweets, etc. I think you have great content, but people are not finding it, apparently. I think the issue is that you are not using hashtags (keywords).
If you start using #hashtags (keywords) on all social media posts, including Youtube descriptions, with links back to targeted website content, signups, and registrations, you’ll see engagement and customer interactions increase by some x percentage.
So, I humbly suggest adding #hashtag keywords to all social media content based on your customer profiles. Keyword research is a must. www.SERanking.com is an example of a site that provides keyword research.
You can even look at what competing companies are using and mimic them.
Finally, you should use a  URL shortener like bitly.com or goo.gl (both have free accounts) to track links on social media channels and track which #hashtage keywords are working and which ones need attention. Your Twitter dashboard gives you some of this, but you’ll want to use a URL shortener to track all social media accounts you use.
All the best, Pete Bakke, Tucson
www.iconicseomarketing.com
Keywords and Hashtags - Peter Bakke