Skip to content

Instantly share code, notes, and snippets.

@theptrk
theptrk / effective_pandas_merge.ipynb
Created July 11, 2022 03:25
effective_pandas_merge.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@theptrk
theptrk / effective_pandas_ch31-styling.ipynb
Created July 11, 2022 03:26
effective_pandas_Ch31+styling.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@theptrk
theptrk / the-spelled-out-intro-to-neural-networks-part-1.ipynb
Created October 20, 2022 15:05
The spelled-out intro to neural networks - Part 1.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@theptrk
theptrk / the-spelled-out-intro-to-neural-networks-part2.ipynb
Created October 20, 2022 15:06
The spelled-out intro to neural networks - Part2.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@theptrk
theptrk / effective_pandas_startch16.ipynb
Created July 7, 2022 04:18
effective_pandas_startCh16.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@theptrk
theptrk / effective_pandas.ipynb
Created July 7, 2022 04:16
effective_pandas.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@theptrk
theptrk / howto_sklearn.ipynb
Last active June 20, 2022 05:28
howto_sklearn_v1.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@theptrk
theptrk / python-sklearn-linear-regression.ipynb
Created June 20, 2022 05:06
python-sklearn-linear-regression.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# Q: what are all the shortest paths from a single node to all other nodes?
"""
Example: All shortest paths from id:0 to all other nodes
{0: [[]],
1: [[1]],
2: [[2]],
3: [[1, 3], [2, 3]],
4: [[1, 3, 4], [2, 3, 4]],
5: [[1, 3, 4, 5], [2, 3, 4, 5]],
# These are SP500 prices for practicing sliding window and array problems.
# Q: What date was the largest adjusted close price?
# Q: What was the longest period of open prices between $3000.00 and $4000.00?
# Q: What was the longest period of increasing open prices?
# Q: What is the most profitable period to buy at the open and sell at the close?
# Q: What is the highest average close price in any 6 month consecutive window of time?
headers = ["Date","Open","High","Low","Close","Adj Close"]
data = [