<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Daniel Gurzi on Medium]]></title>
        <description><![CDATA[Stories by Daniel Gurzi on Medium]]></description>
        <link>https://medium.com/@daniel.gurzi?source=rss-ec7f6d3ba744------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*7cc1QfO1VAEdgER7</url>
            <title>Stories by Daniel Gurzi on Medium</title>
            <link>https://medium.com/@daniel.gurzi?source=rss-ec7f6d3ba744------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 15:48:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@daniel.gurzi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Using Custom .py file in Jupyter]]></title>
            <link>https://medium.com/@daniel.gurzi/using-custom-py-file-in-jupyter-cdefe6af2df4?source=rss-ec7f6d3ba744------2</link>
            <guid isPermaLink="false">https://medium.com/p/cdefe6af2df4</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[general-assembly]]></category>
            <category><![CDATA[custom-functions]]></category>
            <category><![CDATA[jupyter-notebook]]></category>
            <dc:creator><![CDATA[Daniel Gurzi]]></dc:creator>
            <pubDate>Thu, 04 Jun 2020 19:44:52 GMT</pubDate>
            <atom:updated>2020-06-09T00:22:28.996Z</atom:updated>
            <content:encoded><![CDATA[<h3>Using Custom .py file in Jupyter</h3><p>With the NY lockdown in 2020, I wanted to use the downtime to add Python to my resume as a Business Intelligence Manager and Data Scientist. Learning the language itself is pretty straight forward, and there are a TON of useful websites and youtube channels to help.</p><p>I have been processing and analyzing data for nearly a decade, so as I was going through some classes at General Assembly I started tweaking the samples in the classes to make them useful for things I had done before in the real world. So I wanted to store these functions and code snippets in a .py file or library to use with my other courses and have a notebook of calls to take with me in my next venture.</p><p>I’m going to break this up into a few posts to make it easier to understand in each step. First, let’s look at how to save a function to a .py file and call it in a Jupyter notebook.</p><p>This lesson is not to learn python, so if you don’t understand part of it, you can most likely google for the answer, or send me a message for clarification.</p><p>Let’s start in Jupyter with importing NumPy, defining our function for Pythagorean Theorum, and then call the function on a right triangle with a short side equal to 3 and the long side equal to 4. This gives us a 3-4-5 triangle. Fun right?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*QIX0AaSsN7a31IyQyu_RBQ.png" /><figcaption>Python Pythagorean Theorum Function in Jupyter Lab/Notebook</figcaption></figure><p>Since there is no immediate way to call this formula from NumPy you’ll have to run this formula every time you need it. Pretending that this is an equation that we might need in our next job, let’s make something we can take with us and use it whenever needed.</p><h3>STEP 1: Write Code in IDE</h3><p>Open your text Editor of choice. Presently I’m exploring Atom, but Sublime or another IDE, or even basic text editor would work here.</p><p>In your editor, write/paste the first 3 lines. We’ll take the import also so we never have to worry about importing NumPy to run this in the future. (I’m adding lines for comment just for best practice…)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*zh5YErK7bWQEtEv5VTqhRA.png" /><figcaption>Writing Function in IDE</figcaption></figure><h3><strong>Step 2: Save File as .py</strong></h3><p>I’m going to go with py_funk.py (since I will most likely save more functions into this file in the future) and save it to a folder I have called “python_dg” so I know where it is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/436/1*IApOF0oaqrbVfIPIju1jJw.png" /></figure><h3><strong>Step 3: Move File to Jupyter Folder</strong></h3><p>Because we have created a random file that neither Python nor Jupyter know the file path, we need to move this file into the Jupyter Folder with the .ipynb file we are working in. You can move the file in Terminal or with your Finder app. Here you’ll see my new py_funk.py file with my Pythagorean.ipynb file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*wXiKoy9WJRxx7Lb1SnARqw.png" /></figure><h3>Step 4: Import into Jupyter</h3><p>Now that you see the file on the left, we can import it into the Jupyter notebook with the call &lt;from py_funk import path&gt;.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/588/1*wbsHbBRVrPoSh0fVhZLHMA.png" /></figure><p>You can also just import py_funk itself, but then you’ll have to call .path to use that function. As you start to collect a lot of functions this could prove useful, or you could just import the ones you need as a list on the import line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*h57VyzXMnd1ltDbCFrRcJg.png" /></figure><p>Now, obviously this has its drawbacks. Mainly that you have to put that file in the Jupyter folder in which you’re working. Sort of a pain, as you have to copy it and potentially deal with renames, which opens you up to typos and user errors.</p><p>In my next post, I will explore how to save this file to your own local python environment so that you’ll only have to save it once and you can call it in any Jupyter notebook you need.</p><p><strong>Edit</strong>: as a colleague pointed out to me, if you do update the .py file after you’ve imported it into the Jupyter Notebook, you will have to restart your kernel to refresh it in Jupyter. There is a reload function as well to make it automatic, you can research importlib.reload(module_name) for more information on that.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cdefe6af2df4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Data from Necessity]]></title>
            <link>https://medium.com/@daniel.gurzi/data-from-necessity-42ea5942de5e?source=rss-ec7f6d3ba744------2</link>
            <guid isPermaLink="false">https://medium.com/p/42ea5942de5e</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[origin-stories]]></category>
            <category><![CDATA[learn-to-code]]></category>
            <dc:creator><![CDATA[Daniel Gurzi]]></dc:creator>
            <pubDate>Mon, 11 May 2020 02:13:23 GMT</pubDate>
            <atom:updated>2020-05-11T02:13:23.866Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="A wall of blue lights disappearing into the distance" src="https://cdn-images-1.medium.com/max/1024/1*Me5JStfZbXSJGRNUQT-LWQ.jpeg" /></figure><p>I’ve always been a fan of numbers. In grade school, I counted the holes in a single ceiling tile, counted the number of ceiling tiles in the room, multiplied, and smiled. My wife catches me counting stairs to myself at airports. And in quarantine, my son and I always do his math lesson first.</p><p>My first job in NY was for a camera rental company. I grew up in the A/V world and knew enough to get started, but I took to the data formats like a pig in mud. My people skills and determination to win at life put me in a managerial position with budgets, predictions, sales quotas, purchase orders, etc.. Eventually I was hired away by a company that wanted to build a department to rival the one I was now running. They were a photo camera rental house and I had spent the last 4 years specifically with high-end cinema film and commercial production camera equipment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-TzkZuv98JBp4RQzFZXtrw.jpeg" /><figcaption>Revenue Forecasts Up and to the Right</figcaption></figure><p>After 10x’ing their revenue in 3 years things got flat. The numbers stayed constant, but the growth had stopped. I had to start figuring out why. This was the beginning of my career as a data scientist. Our business was on the 6th floor, accessible by only a small elevator. How many clients can we possible get in and out in a day? How long does it take to load out a client with their gear?</p><p>Eventually, my research led me to a single discovery. I found the median of all transactions in the previous year and calculated that the total business from all orders below the mean accounted for 8% of our annual revenue, while the other half of our orders covered the other 92%. So we could cut our workload in half, save the 8% loss on reduced payroll, have more space to add more high-end clients, and be back on the road to growth.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9DtPdsxnykADYruPsY_bEw.jpeg" /><figcaption>SQL &amp; Python Coding</figcaption></figure><p>It was this singular project, discovery process, and presentation to the bosses and ignited an unsatiable interest in data science. Can the solution to a business’s struggles be buried within itself? Is it always this easy? As I’ve continued my journey through SQL, and Python, Regression models and probability matrices, I learn more ways to slice and dice datasets, and dig out new hypotheses.</p><p>All networking opportunities are welcome.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=42ea5942de5e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>