Uh man.

writing and writing and coding and coding.

welcome to day 27 and 28.

Yesterday I coded. And I just scoured documentation. I mostly read documentation. Some of it was bad.

I have been reading documentation and scouring and reading and coding and reading and documentatoinssssss

OH WOW.

Guess what else is a REALLY important part of this challenge.

REST. IT'S SO IMPORTANT I CAN'T POSSIBLY KNOW WHERE TO START TO MAKE A POINT CLEAR ENOUGH.

I took so many cat naps. I have a cat so I just modeled my behavior after her and

BOOM.

Now I know about machine learning

Whatchu you know about that.

hilarious obligatory meme for test

Anyway. I've been code. Coding. I've been coding. Don't. stop. Get off my case.

the nerve.

the posts are here okay. Today I might post a few.

This first one I am going to call something about solving relavent problems

In [9]:
import pandas as overchargedproblemsolvingmagic_stuff
In [24]:
problems = ['didn\'t have snazzy website', 'can\'t seem to connect with dev twitter']
solutions = ['do what i know how to do to make website MORE snazzy','finds data science twitter stuff']
business_stuff = overchargedproblemsolvingmagic_stuff.DataFrame([problems,solutions])
In [32]:
business_stuff.loc[0,1], business_stuff.loc[0,0]
# TODO "use loc" the documentation should say
Out[32]:
("can't seem to connect with dev twitter", "didn't have snazzy website")

look I mean, I'm a magician obviously. it says. right up there. go ahead check I'll wait.

Half the battle is reading documentation. If that sounds boring to you then that sucks and I feel you.

However. Let me tell you. I have been a tutorial chaser for a better part of my days. And with that comes "finding that ONE tutorial I did with the thing and the stuff".

Yeah. Not gonna find that. Unless you linked it. And made a github repo and blah.

HOWEVER

really this time. I swear. I swear it.

I have learned so much about programming in the last three days from solely skimming documentation and testing out things.

Yes I feel like sometimes I'm not looking at probably the most important part of the code. But look watch wait.


super awesome sub hint inbound:

I will admit. Having a great IDE (an integrated development environment) is super key.

LIKE SO KEY

in this. Being able to access choice documentation RIGHT when you're coding and RIGHT when you need it is so slick.

THIS IS WHAT ELSE I LEARNED

Reading documentation is key because it's essential to find BAD DOCUMENTATION.

I'm working with this thing in this library that I like. It's from a library called nltk and I found some terrible documentation there and I think I can fix it.

So yeah.. no big deal. Might make some moves to contribute to open source..It's cool.

Maybe I can bother some people and learn something along the way.

Alright. That's all I have for now. Actually just kidding here is some supplemental hire worthy material if a hiring manager gets bored later

In [41]:
df_test = overchargedproblemsolvingmagic_stuff.DataFrame({
                    "A": ["col1", "col2", "col3", "col4", "col5", "col6", "col7", "col8", "col9"],
                    "B": ["one", "one", "one", "two", "two","one", "one", "two", "two"],
                    "C": ["small", "large", "large", "small", "small", "large", "small", "small", "large"],
                    "D": [1, 2, 2, 3, 3, 4, 5, 6, 7],
                    "E": [2, 4, 5, 5, 6, 6, 8, 9, 9]
})

That's a little data thing I found in Panda docs earlier today explaining how to do pivot tables. It was so confusing. Here's what I learned.

In [42]:
df_test # boring.
Out[42]:
A B C D E
0 col1 one small 1 2
1 col2 one large 2 4
2 col3 one large 2 5
3 col4 two small 3 5
4 col5 two small 3 6
5 col6 one large 4 6
6 col7 one small 5 8
7 col8 two small 6 9
8 col9 two large 7 9
In [44]:
df_test_pivot = overchargedproblemsolvingmagic_stuff.pivot_table(df_test, index=["C"], columns=["A"])
df_test_pivot_ca
Out[44]:
D E
A col1 col2 col3 col4 col5 col6 col7 col8 col9 col1 col2 col3 col4 col5 col6 col7 col8 col9
C
large NaN 2.0 2.0 NaN NaN 4.0 NaN NaN 7.0 NaN 4.0 5.0 NaN NaN 6.0 NaN NaN 9.0
small 1.0 NaN NaN 3.0 3.0 NaN 5.0 6.0 NaN 2.0 NaN NaN 5.0 6.0 NaN 8.0 9.0 NaN
In [45]:
def pivot_table_by_lines(data,a,b):
    return overchargedproblemsolvingmagic_stuff.pivot_table(data, index=[a],columns=[b])
In [47]:
pivot_table_by_lines(df_test,"C","A")
Out[47]:
D E
A col1 col2 col3 col4 col5 col6 col7 col8 col9 col1 col2 col3 col4 col5 col6 col7 col8 col9
C
large NaN 2.0 2.0 NaN NaN 4.0 NaN NaN 7.0 NaN 4.0 5.0 NaN NaN 6.0 NaN NaN 9.0
small 1.0 NaN NaN 3.0 3.0 NaN 5.0 6.0 NaN 2.0 NaN NaN 5.0 6.0 NaN 8.0 9.0 NaN
right. so..
In [48]:
# time to make some rows out of some colxs,x being number of row and 's' making 'col' plural
pivot_table_by_lines(df_test,"A","D")
Out[48]:
E
D 1 2 3 4 5 6 7
A
col1 2.0 NaN NaN NaN NaN NaN NaN
col2 NaN 4.0 NaN NaN NaN NaN NaN
col3 NaN 5.0 NaN NaN NaN NaN NaN
col4 NaN NaN 5.0 NaN NaN NaN NaN
col5 NaN NaN 6.0 NaN NaN NaN NaN
col6 NaN NaN NaN 6.0 NaN NaN NaN
col7 NaN NaN NaN NaN 8.0 NaN NaN
col8 NaN NaN NaN NaN NaN 9.0 NaN
col9 NaN NaN NaN NaN NaN NaN 9.0
In [50]:
pivot_table_by_lines(df_test,"B","C")
Out[50]:
D E
C large small large small
B
one 2.666667 3.0 5.0 5.000000
two 7.000000 4.0 9.0 6.666667

dang. what are pivot tables?

another way to look at data friend.

peace stalkers.