Thursday, April 11, 2019

pandas : drop rows with null only from specific columns

 aka : drop rows for certain columns if null

Tough one to find - and of course, as usual, DuckDuckGone is totally useless..

Thank you Google : 

df.dropna( axis=0, subset=column_list )

Sunday, April 07, 2019

Thank You Charlie Nuttelman : Excel VBA Stuff

So much I didn't know about - man - you don't get to be a trillion $ company with a cash cow unless it has some serious bells and w.

Relative referencing while recording macros - this can make you more productive building a macro to automate a recurring task - check it out!
The Locals window - watch your productivity zoom, already!

The thing that didn't do much for me was the Object Browser - a clear tutorial might help there.. (BTW, you might find his start in Lesson 14 adorable. You'll see how you easily put together something like

Private Sub Workbook_WindowResize(ByVal Wn As Window)
MsgBox ("You resized me!")
End Sub

which is very cute :) )

Other things I must thank the Nutty Professor for :

  1. Exit For, Exit Sub, Exit Do -- sometimes ease trumps elegance
  2. Option Base 1 -- when you want to be a lay person and count starting from 1 :)
  3. ReDim Preserve -- you declare a variable and now, you know how big your array is going to be (or you need to resize it - make it one bigger, and, if you don't say Preserve, you're going to reset all elements to 0... So..
  4. Relative Referencing while recording macros - so cool :)
  5. The Locals Window! What a lifesaver
  6. Declare (Dim) at the Module level, and you can access in all modules
  7. Optional arguments to Functions and Static Variables
  8. All Dim'd variables start out with a value of 0
  9. Debugging : run to cursor : CTRL-F8
  10. If you want your code to automatically enter debug mode upon a certain condition being met : Debug.Assert <condition>
  11. If you're in the VB Editor, ALT-F11 takes you back to the Workbook - you'd think I'd know that one :)
  12. XLAM - Excel Macro Add in - how to Add-in/make a function available
  13. How to run a VBA routine from another file
  14. The Object Browser - like I said the YT tutorial by ExcelVBAHelp is better
  15. You can do .Range of a Range, because a Range is now its own Spreadsheet!
  16. Application.ScreenUpdating = False -- to get stuff to finish faster
  17. Goal Seek, Solver, Bisection Method, Circular Calculation enabling
  18. The power of Dim'ing as Variant - for an array - assign selection without for loops..

How to Become a Great Gun Designer

MK (of AK-47 fame ) : When I was a young boy, there was not a single door lock around that I wouldn't have disassembled to see what was inside and how they worked. I was very young and fascinated by machines. But, in my village, there was no chance to study machines.



"I read in some book, maybe holy scripture that all that is complex is not useful and all that is useful is simple. This is my whole life's motto." -- love that one :) So does Steve Jobs (late).

Wikipedia : .. a self-taught tinkerer who combined innate mechanical skills with the study of weaponry to design arms that achieved battlefield ubiquity.

So, to sum up, what have the Russians given the world? The AK-47, Tetris, and.. you tell me..

Where Is Your PERSONAL.XLSB (Personal Macro Workbook) Located?

For a change, Google didn't just spit out the answer right away..


What you do :

  1. Make it visible (View Tab > Unhide > PERSONAL)
  2. Press F12

And you get to see.. In my case :

C:\Users\<name>\AppData\Local\Packages\Microsoft.Office.Desktop_weirdbuchofchards\LocalCache\Roaming\Microsoft\Excel\XLSTART

Tuesday, April 02, 2019

Pat Sweet : Thou Shalt Be an Engineering Leader

Got into blogging because he enjoyed writing ( https://youtu.be/oxlq8R2AmQo : 14:35 - he loved mentoring - being asked good questions by junior engineers, especially non-technical ones )

What is Leadership not?

Management
Charisma (B. Gates, Darwin E. Smith, etc are not charismatic, but were successful)
Technical Mastery
Innate - you can learn
For senior staff only

Is :

Good stewardship
Practising good habits
Selflessness
Action oriented (bold)
Concern for followers
People-focused

Eisenhower : Getting people to want to do what you want them to do ( motivation :)

A balance of personal humility with intense professional will. (Level 5 Lship)

How :

Have purpose
Set goals
Read, read, read
Train continuously
Look for opportunities - volunteer - new projects, new initiatives, cold case files.