<?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 Reshama Shaikh on Medium]]></title>
        <description><![CDATA[Stories by Reshama Shaikh on Medium]]></description>
        <link>https://medium.com/@reshamas?source=rss-5ad813ef7ce0------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*mBNbTT_EVn6K4cuZOOlAyw.jpeg</url>
            <title>Stories by Reshama Shaikh on Medium</title>
            <link>https://medium.com/@reshamas?source=rss-5ad813ef7ce0------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 16 Apr 2026 00:34:03 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@reshamas/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[Deploying A Deep Learning Model on Mobile Using TensorFlow and React]]></title>
            <link>https://medium.com/data-science/deploying-a-deep-learning-model-on-mobile-using-tensorflow-and-react-4b594fe04ab?source=rss-5ad813ef7ce0------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b594fe04ab</guid>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[tensorflowjs]]></category>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Reshama Shaikh]]></dc:creator>
            <pubDate>Sat, 09 Oct 2021 21:55:06 GMT</pubDate>
            <atom:updated>2022-01-13T19:37:37.814Z</atom:updated>
            <content:encoded><![CDATA[<h4>We cover how to build a cross-platform mobile app (for both iOS and Android) using React Native and TensorFlowJS React Native adaptor</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DybBVNqDc59WnEViHylNNQ.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@annapelzer?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Anna Pelzer</a> on <a href="https://unsplash.com/s/photos/food-salad?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>This project was completed jointly by <a href="https://medium.com/@npatta01">Nidhin Pattaniyil</a> and <a href="https://medium.com/@reshamas">Reshama Shaikh</a>.</p><p>As mobile phones have become more accessible, consequently, mobile use has been increasing. Users are utilizing mobile devices over desktop more frequently, and apps on mobile are in high demand. These internet-connected devices provide an opportunity to bring the inference models closer to the user.</p><h3>Outline</h3><ul><li>About the Data: Food-101</li><li>PART 1: Training an Image Classifier Using TensorFlow</li><li>PART 2: Converting the Model</li><li>PART 3: Considerations for Inference: Running on Server vs. Client</li><li>PART 4: Deploying the Web App</li><li>PART 5: Deploying the Mobile App</li></ul><h3>About the Data: Food-101</h3><p>The <a href="https://www.tensorflow.org/datasets/catalog/food101">Food-101</a> data is used for this project, which includes 101 food categories for a total of 101,000 images. Thus, each class has 1,000 images, of which 250 are manually reviewed test images, and 750 are training images. The categories of the ETHZ Food-101 are the 101 most popular categories from the food picture sharing website foodspotting.com.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/699/1*4at66wIRCP0MMiupkIT7-g.jpeg" /><figcaption><a href="https://www.tensorflow.org/datasets/catalog/food101">Food-101 Dataset</a></figcaption></figure><p><strong>Data citation</strong></p><p>Bossard, Lukas and Guillaumin, Matthieu and Van Gool, Luc, Food 101 Mining Discriminative Components with Random Forests, European Conference on Computer Vision, 2014.</p><h3>PART 1: Training an Image Classifier using TensorFlow</h3><p>The image classifier was trained using TensorFlow 2.3.4. The code is available for reference in <a href="https://github.com/reshamas/deploying-web-app/blob/main/notebooks/2021_09_20_1_run_dl_model_101_classes.ipynb">this notebook</a> on GitHub. There are a number of pre-trained <a href="https://keras.io/api/applications/">models</a> available in TensorFlow 2 / Keras. We used the ResNet50 and MobileNetV2 architectures. The MobileNet model family is mobile-friendly, and it will be used for the mobile app.</p><h4>Table 1: Compare Model Architectures</h4><p>We present below a table comparing models with respect to accuracy, number of parameters, and model size.</p><p>MobileNetV2 is a mobile-friendly architecture with fewer parameters. The final model that was used in the mobile app deployment is a MobileNetV2 fine-tuned model which had about 66% accuracy.</p><figure><img alt="table with 4 rows showing parameters for 4 models" src="https://cdn-images-1.medium.com/max/1024/1*6LM_SPua1WEV85vr_C9iVw.png" /><figcaption>Image by Author</figcaption></figure><h3>PART 2: Converting the Model (Quantization &amp; Optimization)</h3><p>We downloaded the model.h5 and classes.json (this is the list of food class names) files to our local computer into a folder named model_tf and did our model conversions within a virtual environment.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e08a9c81c39962d99712085aa686196b/href">https://medium.com/media/e08a9c81c39962d99712085aa686196b/href</a></iframe><p>The model we created, model.h5, is in the format “TensorFlow Keras”. We needed to convert it to the “TensorFlow.js” format because that is needed for client-side inference. We are converting the default tensorflow.js model for a few reasons:</p><ul><li><strong>Model shards</strong>: Our model file is large, and the default tensorflow.js breaks the model down into 5 MB shards. For deploying the mobile app, we need one file, so we are specifying weight_shard_size_bytes of 50,000,000 bytes to get that file.</li><li><strong>Inference-speed optimization using </strong><a href="https://livebook.manning.com/book/deep-learning-with-javascript/chapter-12/1#search"><strong>GraphModel conversion</strong></a></li></ul><blockquote>How does GraphModel conversion boost TensorFlow.js models’ inference speed? It’s achieved by leveraging TensorFlow (Python)’s ahead-of-time analysis of the model’s computation graph at a fine granularity. The computation-graph analysis is followed by modifications to the graph that reduce the amount of computation while preserving the numeric correctness of the graph’s output result.</blockquote><ul><li><strong>Inference-speed optimization using Quantization: </strong>Quantization is a post-training technique to reduce the size of models. Here, we use quantization to decrease the default 32-bit precision to 16-bit precision which will reduce the model file size by half.</li></ul><p>We combined all 3 conversion steps into this:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/2d2e99e5e75de0eec5ddfe962c761442/href">https://medium.com/media/2d2e99e5e75de0eec5ddfe962c761442/href</a></iframe><p>We saved our converted model file and uploaded it to GitHub releases area of our mobile repo: <a href="https://github.com/reshamas/deploying-mobile-app/release">deploying-mobile-app/release</a></p><p>These model and classes files will be used as input when creating the web app.</p><h4>Table 2: Model Size for MobileNetV2</h4><p>Note that the quantized model size has been reduced by 50%, from 14MB to 6.9MB. Inference times are similar for both model sizes. For most cases, <a href="https://livebook.manning.com/book/deep-learning-with-javascript/chapter-12/1">the literature</a> shows that 16-bit quantization does not impact accuracy significantly.</p><pre>Web App:  Compare Model Size Before &amp; After Optimization and Quantization</pre><pre>╔═════════════╦════════════════════╗<br>║ Model       ║ Model Size         ║ <br>║             ║                    ║        <br>╠═════════════╬════════════════════╣<br>║ MobileNetV2 ║ 14MB               ║<br>║             ║                    ║                   <br>╠═════════════╬════════════════════╣<br>║ MobileNetV2 ║  6.9MB             ║             <br>║  (16-bit    ║                    ║                   <br>║   quantized)║                    ║                   <br>╚═════════════╩════════════════════╝</pre><h3>PART 3: Considerations for Inference: Running on Server vs. Client</h3><h4>Latency/Network connection of user</h4><p>In server-side inference, once the image/text is received, the inference time is consistent. However, the total time is determined by the user’s network upload speed. In <em>client-side</em> inference, the inference time is dependent on the <em>hardware</em> that the user is running.</p><h4>Privacy</h4><p>For sensitive data, users might be uncomfortable with sending the data to a server. Client-side inference allows users to run their workload securely.</p><h4>Future updates to models</h4><p>A benefit of server-side inference is the ability to deploy new, state-of-the-art models and consistently update them. In client-side inference, deployment of new models is restricted by the user’s expressed update frequency.</p><h4>State of the art models vs. mobile optimized</h4><p>Due to client hardware and storage restrictions, models that are small and optimized for inference are ideal. Most websites on the web are less than 2 MB of JavaScript code and CSS. The simplest model we created was about 20 MB, which is still not ideal for serving on the web. Therefore, most models currently are served on a server.</p><h3>PART 4: Deploying the Web App</h3><p>We used this template repository to deploy the web. The template repository is one web app that does both server-side and browser-based inference: <br><a href="https://github.com/reshamas/deploying-web-app.git">deploying-web-app</a></p><p>We copied the model to our forked repo.</p><p>This is the original file from Colab: model.h5<br>This is the converted TensorFlow.js file: model_tfjs</p><p>The structure of the repository with the model files is as below. We placed the original and converted model in the directory backend/assets.</p><pre>├── backend<br>│   ├── app.py<br>│   ├── assets<br>│   │   ├── classes.json<br>│   │   ├── model_tf<br>|   |   |──├──model.h5<br>│   │   └── model_tfjs<br>│   │       ├── group1-shard1of1.bin<br>│   │       └── model.json</pre><h4>Serving the Web App Locally</h4><p>There are various options for serving web apps in Python, including Flask, Django, and FastAPI.</p><p>We served out browser app with FastAPI and used React for the frontend framework.</p><p>First, we ran the app locally using Docker.</p><p>The repo provides a <a href="https://github.com/reshamas/deploying-web-app/blob/main/Dockerfile">Docker file</a> to run the app. Run these commands to launch the app. The first time you run using Docker, it could take up to 10 minutes. This command needs to be run at the base level of your repo where the Dockerfile file is located.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5655cd6184b21d00860ffa86e90cd758/href">https://medium.com/media/5655cd6184b21d00860ffa86e90cd758/href</a></iframe><p>Running the above two commands starts a web server running locally on the machine.</p><p>The server can be accessed locally at <a href="http://localhost:8000/">http://localhost:8000</a>.</p><p>Voilà! We have a web app running locally! It looks like the following demo.</p><h4>Demo of Web App</h4><p>This app is in production at: <a href="https://manning-deploy-imagenet.herokuapp.com/">manning-deploy-imagenet.herokuapp.com</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*guBzW49UCm8kwtvI5Zaqjw.gif" /><figcaption>Image by Author</figcaption></figure><h4>Serving the Web App to a Cloud Platform (Heroku)</h4><p><a href="https://www.heroku.com/home">Heroku</a> is a nice, free option for deploying the app.</p><p>Once the Heroku command-line tools are installed, it can be run using the below commands.</p><p>Replace APP_NAME with something unique. The below steps could take some time (5 to 10 minutes) depending on your internet upload speed. For our project, we set APP_NAME=&quot;manning-deploy-imagenet&quot;.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8797c421eb6786496a4a77733258af78/href">https://medium.com/media/8797c421eb6786496a4a77733258af78/href</a></iframe><p>The app can be tried out here: <a href="https://manning-deploy-imagenet.herokuapp.com/">manning-deploy-imagenet.herokuapp.com</a></p><h3>Inference times</h3><p>We measured the latency for several sample images. We experimented with images of different sizes and visited the site on desktop and mobile.</p><h4>Table 3: Inference Times for Web App</h4><pre>Web App:  Compare Inference Times</pre><pre>╔═════════════╦════════════════════╦═══════════════════╦════════╗<br>║ Inference   ║ Desktop Browser    ║ Mobile Browser    ║ Model  ║<br>║ Source      ║ duration           ║ duration          ║ Size   ║<br>║             ║ (Inference in ms)  ║ (Inference in ms) ║        ║        <br>╠═════════════╬════════════════════╬═══════════════════╣════════╣<br>║ Server      ║ 559                ║ 594               ║ 29MB   ║<br>║ (Heroku)    ║ (202)              ║ (180)             ║        ║ <br>╠═════════════╬════════════════════╬═══════════════════╣════════╣<br>║ Browser     ║ 50                 ║ 177               ║ 6.9MB  ║<br>║             ║                    ║                   ║        ║ <br>╚═════════════╩════════════════════╩═══════════════════╩════════╝</pre><pre><strong>NOTES<br></strong>The above results show the latency cost associated with sending an image to the server for inference.</pre><pre>* For the Server (Heroku) model, it is the h5 file, the keras model.<br>* For the Browser model, it is the post-training quantized and optimized model. (converted using TensorFlow.js)</pre><h3>PART 5: Deploying the Mobile App</h3><p>The benefit of having inference running natively on a mobile app is that it is functional without an internet connection. Because the model is running on the user’s device, the latency is lower. Inference running locally on the device also protect’s the user’s privacy.</p><p>We used React Native and TensorFlowJS React Native adaptor since it allowed us to build a cross-platform mobile app.</p><p>We used this template repository to deploy the mobile web; it works for both iOS and Android: <a href="https://github.com/reshamas/deploying-mobile-app">deploying-mobile-app</a></p><p>We uploaded the tfjs converted model file to the <a href="https://github.com/reshamas/deploying-mobile-app/releases">releases</a> section.</p><p>The inference is happening in the file <a href="https://github.com/reshamas/deploying-mobile-app/blob/main/components/ModelService.tsx#L110">ModelService.tsx</a>. To initialize the TensorFlow.js model, ModelService.tsx calls the below code in the create method.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/4e9d5d0c6022d66a0440bc13f6a742d0/href">https://medium.com/media/4e9d5d0c6022d66a0440bc13f6a742d0/href</a></iframe><p>Below is the core code used for getting a prediction from an image used in classifyImage.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f4a6638621b84bb4811c0c4e11e910a1/href">https://medium.com/media/f4a6638621b84bb4811c0c4e11e910a1/href</a></iframe><p><a href="https://expo.io/">Expo</a> is a free and open-source toolchain built around React Native to help build cross-platform native iOS and Android projects using JavaScript and React. The JavaScript environment that is commonly used for building apps is <a href="https://nodejs.org/en/">Node</a>. To run this app, we use <a href="https://classic.yarnpkg.com/en/docs/install">yarn</a>, which is used to install JavaScript packages like Expo. After yarn has been installed, we did:</p><p>yarn run start</p><p>The next step is to open the Expo app and once you are logged in, you should see the app listed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/738/1*th1xFW_U3bP8txOBi4-zJg.jpeg" /><figcaption>Image by Author</figcaption></figure><h4>Demo of Mobile App</h4><p>This mobile app is in production at:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*15yM2CfNQjOP-IcAmAGRbA.gif" /><figcaption>Image by Author</figcaption></figure><h4>Table 4: Comparing Inference Times for Mobile App</h4><p>Note: We would expect the inference time for the mobile app to be faster. It’s a bit slower here. It could be due to the React Native adaptor not being mature.</p><pre>Mobile App:  Compare Inference Times<br>╔═════════════╦════════════════════╦═══════════════════╗<br>║ Inference   ║ Mobile Browser     ║ Mobile App        ║ <br>║ Source      ║ duration           ║ duration          ║ <br>║             ║ (Inference in ms)  ║ (Inference in ms) ║        <br>╠═════════════╬════════════════════╬═══════════════════╣ <br>║ Pixel 1     ║ 310                ║ 411               ║ <br>║ (2016)      ║                    ║                   ║ <br>╠═════════════╬════════════════════╬═══════════════════╣ <br>║ iPhone XS   ║ 220                ║ 327               ║       <br>║ (2019       ║                    ║                   ║        <br>╚═════════════╩════════════════════╩═══════════════════╝</pre><pre><strong>NOTES<br></strong>Both the mobile browser and app allow you to run inference in less than 1 second. This performance is acceptable for a mobile app.</pre><h3>Summary</h3><p>This article provides an outline for how to run a deep learning classifier using TensorFlow, and how to serve the model on both web and mobile. For more step-by-step instructions, check out our Manning liveProject: <a href="https://www.manning.com/liveproject/deploying-a-deep-learning-model-on-web-and-mobile-applications?utm_source=dataumbrella&amp;utm_medium=affiliate&amp;utm_campaign=liveproject_pattaniyil_02_03_21&amp;utm_content=published&amp;a_aid=dataumbrella&amp;a_bid=187b748d"><strong>Deploying a Deep Learning Model on Web and Mobile Apps</strong></a> (using TensorFlow and React). The first milestone of this project, which focuses on training the model, is available publicly.</p><figure><img alt="rectangle with purple background and title of project" src="https://cdn-images-1.medium.com/max/216/1*UXXVc0CQcrsgo3rCgoVCUg.png" /><figcaption>liveProject: <a href="https://www.manning.com/liveproject/deploying-a-deep-learning-model-on-web-and-mobile-applications?utm_source=dataumbrella&amp;utm_medium=affiliate&amp;utm_campaign=liveproject_pattaniyil_02_03_21&amp;utm_content=published&amp;a_aid=dataumbrella&amp;a_bid=187b748d">Deploying a Deep Learning Model</a></figcaption></figure><p>We focus our presentation using TensorFlow-serving because the TensorFlow ecosystem for deploying mobile apps is more mature than the PyTorch one. PyTorch Mobile was released approximately October 2019, and TensorFlow Lite was released in May 2017.</p><h3>Video</h3><p>We presented on this topic at PyData Global 2021. There is a 30-minute video with Q&amp;A discussion at the end.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Ftqk2eCsd_Fs%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Dtqk2eCsd_Fs&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Ftqk2eCsd_Fs%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/2b9328c0d0540a47c81df0fa16cd000b/href">https://medium.com/media/2b9328c0d0540a47c81df0fa16cd000b/href</a></iframe><h3>References</h3><ul><li><a href="https://www.manning.com/liveproject/deploying-a-deep-learning-model-on-web-and-mobile-applications">Deploying a Deep Learning Model on Web and Mobile Apps</a> (TensorFlow, React) [Manning liveProject]</li><li>GitHub repo: <a href="https://github.com/reshamas/deploying-web-app">deploying-web-app</a> (TensorFlow, React)</li><li>GitHub repo: <a href="https://github.com/reshamas/deploying-mobile-app">deploying-mobile-app</a> (TensorFlow, React Native)</li><li><a href="https://reshamas.github.io/deploying-deep-learning-models-on-web-and-mobile/">Deploying Deep Learning Models on Web and Mobile</a> (fastai, PyTorch, React)</li><li><a href="https://livebook.manning.com/book/deep-learning-with-javascript/chapter-12">Deep Learning with JavaScript: Neural networks in TensorFlow.js</a> by Shanqing Cai, Stanley Bileschi, Eric D. Nielsenn and Francois Chollet; Chapter 12. Testing, optimizing, and deploying models</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b594fe04ab" width="1" height="1" alt=""><hr><p><a href="https://medium.com/data-science/deploying-a-deep-learning-model-on-mobile-using-tensorflow-and-react-4b594fe04ab">Deploying A Deep Learning Model on Mobile Using TensorFlow and React</a> was originally published in <a href="https://medium.com/data-science">TDS Archive</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enriching Data Visualizations with Annotations in Plotly using Python]]></title>
            <link>https://medium.com/nerd-for-tech/enriching-data-visualizations-with-annotations-in-plotly-using-python-6127ff6e0f80?source=rss-5ad813ef7ce0------2</link>
            <guid isPermaLink="false">https://medium.com/p/6127ff6e0f80</guid>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[plotly-express]]></category>
            <dc:creator><![CDATA[Reshama Shaikh]]></dc:creator>
            <pubDate>Sun, 15 Aug 2021 21:47:55 GMT</pubDate>
            <atom:updated>2021-10-04T02:42:38.789Z</atom:updated>
            <content:encoded><![CDATA[<h4>“A picture is worth a thousand words.” Indeed it is, and an <strong>annotated</strong> picture is worth its contribution to data literacy.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*zKQzyL7KOCNiJ7Cn0z5M2A.png" /></figure><p>With the advances in programming and computing, data scientists can now do state-of-the-art visualizations without requiring in-depth knowledge of D3 or Javascript. We can accomplish this using the python library plotly!</p><p>For these examples, I am using Python version 3.9 and <a href="https://pypi.org/project/plotly/">plotly version</a> 5.1.0.</p><p>A video version of annotations in plotly is available on <a href="https://youtu.be/D2vsLy85rog">YouTube</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YF90BJ00b5M11cBvs4akCA.png" /><figcaption><a href="https://youtu.be/D2vsLy85rog">Enriching Data Visualizations with Annotations in Plotly</a> (10-minute presentation)</figcaption></figure><h3>STEP 1: Read in sample data for visualization</h3><pre>import pandas as pd</pre><pre>event_dates = [&#39;2020-01-01&#39;, &#39;2020-02-01&#39;, &#39;2020-03-01&#39;,<br>               &#39;2020-04-01&#39;, &#39;2020-05-01&#39;, &#39;2020-06-01&#39;, <br>               &#39;2020-07-01&#39;, &#39;2020-08-01&#39;, &#39;2020-09-01&#39;, <br>               &#39;2020-10-01&#39;, &#39;2020-01-01&#39;, &#39;2020-02-01&#39;, <br>               &#39;2020-03-01&#39;, &#39;2020-04-01&#39;, &#39;2020-05-01&#39;, <br>               &#39;2020-06-01&#39;, &#39;2020-07-01&#39;, &#39;2020-08-01&#39;, <br>               &#39;2020-09-01&#39;, &#39;2020-10-01&#39;]</pre><pre>groupid = [&#39;A&#39;, &#39;A&#39;, &#39;A&#39;, &#39;A&#39;, &#39;A&#39;, &#39;A&#39;, &#39;A&#39;, &#39;A&#39;, &#39;A&#39;, &#39;A&#39;,<br>           &#39;B&#39;, &#39;B&#39;, &#39;B&#39;, &#39;B&#39;, &#39;B&#39;, &#39;B&#39;, &#39;B&#39;, &#39;B&#39;, &#39;B&#39;, &#39;B&#39;]</pre><pre>outcome = [92,  93, 107,  91, 113,  83,  87,  99, 101, 107, <br>           103, 145, 131, 116, 131, 109, 108, 105,  96, 127]</pre><pre>data = {&#39;event_date&#39;: event_dates,<br>        &#39;groupid&#39;: groupid,<br>        &#39;outcome&#39;: outcome}</pre><pre># create the dataframe from the arrays<br>df = pd.DataFrame(data)</pre><p>Look at data frame, by sampling a few rows: df.sample(5)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*pcpYcxIIm51thLDcyfdEww.png" /></figure><h3>STEP 2: Create a basic, 2-group, line plot</h3><pre>import plotly.express as px</pre><pre>fig = px.line(df<br>              , x=&#39;event_date&#39;<br>              , y=&#39;outcome&#39;<br>              , color=&#39;groupid&#39; <br>              , title = &quot;Event Data Over Time for Two Groups&quot;)</pre><pre>fig.show()</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplotly.com%2F%7Ereshamas%2F14.embed%3Fautosize%3Dtrue&amp;display_name=Plotly&amp;url=https%3A%2F%2Fchart-studio.plotly.com%2F%7Ereshamas%2F14%2F&amp;image=https%3A%2F%2Fchart-studio.plotly.com%2Fstatic%2Fwebapp%2Fimages%2Fplotly-logo.8d56a320dbb8.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=plotly" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/da1e0304bf000bda31956e2448e2fd35/href">https://medium.com/media/da1e0304bf000bda31956e2448e2fd35/href</a></iframe><h3>STEP 3: Extend the x-axis range a bit</h3><p>Let’s extend the x-axis on the left and right a little bit, so it is cleaner and easier to read and the graph doesn’t go to the edges.</p><p>This parameter gives options for the x-axis range: range_x=[..., ...]</p><pre># extend the x-axis range</pre><pre>fig = px.line(df<br>    , x=&#39;event_date&#39;<br>    , y=&#39;outcome&#39;<br>    , color=&#39;groupid&#39;<br>    , title = &quot;Event Data Over Time for Two Groups”<br>    , range_x=[&#39;2019–12–01&#39;, &#39;2020–11–01&#39;],)</pre><pre>fig.show()</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplotly.com%2F%7Ereshamas%2F16.embed%3Fautosize%3Dtrue&amp;display_name=Plotly&amp;url=https%3A%2F%2Fchart-studio.plotly.com%2F%7Ereshamas%2F16%2F&amp;image=https%3A%2F%2Fchart-studio.plotly.com%2Fstatic%2Fwebapp%2Fimages%2Fplotly-logo.8d56a320dbb8.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=plotly" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/9aefad852a449cb6093e197147993575/href">https://medium.com/media/9aefad852a449cb6093e197147993575/href</a></iframe><h3>STEP 4: Add an author and data source footnote</h3><p>This allows us to add a footnote annotation: fig.add_annotation(...).</p><pre>fig = px.line(df<br>    , x=&#39;event_date&#39;<br>    , y=&#39;outcome&#39;<br>    , color=&#39;groupid&#39;<br>    , title = &quot;Event Data Over Time for Two Groups&quot;<br>    , range_x=[&#39;2019-12-01&#39;, &#39;2020-11-01&#39;],)</pre><pre>fig.update_layout(autosize=False, width=800, height=600,)</pre><pre># add today&#39;s date<br>from datetime import date<br>today = date.today()</pre><pre># HOW TO ADD A FOOTNOTE TO BOTTOM LEFT OF PAGE<br>fig.add_annotation(<br>    text = (f&quot;<a href="http://twitter.com/reshamas">@reshamas</a> / {today}&lt;br&gt;Source: JHU CSSE&quot;)<br>    , showarrow=False<br>    , x = 0<br>    , y = -0.15<br>    , xref=&#39;paper&#39;<br>    , yref=&#39;paper&#39; <br>    , xanchor=&#39;left&#39;<br>    , yanchor=&#39;bottom&#39;<br>    , xshift=-1<br>    , yshift=-5<br>    , font=dict(size=10, color=&quot;grey&quot;)<br>    , align=&quot;left&quot;<br>    ,)</pre><pre>fig.show()</pre><p><strong>Tip</strong>: you may want to adjust the above values for x and y as well as for xshift and yshift, depending on the size of your graph.</p><p><strong>Tip</strong>: the br in the footnote text represents a line break.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplotly.com%2F%7Ereshamas%2F18.embed%3Fautosize%3Dtrue&amp;display_name=Plotly&amp;url=https%3A%2F%2Fchart-studio.plotly.com%2F%7Ereshamas%2F18%2F&amp;image=https%3A%2F%2Fchart-studio.plotly.com%2Fstatic%2Fwebapp%2Fimages%2Fplotly-logo.8d56a320dbb8.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=plotly" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/53b21ec2035bcf513ec03ab8ff86d2a4/href">https://medium.com/media/53b21ec2035bcf513ec03ab8ff86d2a4/href</a></iframe><h3>STEP 5: Add an annotation with a box &amp; opacity</h3><pre>fig = px.line(<br>    df<br>    , x=&#39;event_date&#39;<br>    , y=&#39;outcome&#39;<br>    , title = &quot;Event Data Over Time for Two Groups&quot;<br>    , color=&quot;groupid&quot;<br>    , range_x=[&#39;2019-12-01&#39;, &#39;2020-11-01&#39;],<br>)<br>fig.update_layout(<br>    autosize=False,<br>    width=800,<br>    height=600,)</pre><pre># add today&#39;s date<br>from datetime import date<br>today = date.today()</pre><pre># HOW TO ADD A FOOTNOTE TO BOTTOM LEFT OF PAGE<br>fig.add_annotation(<br>    text = (f&quot;<a href="http://twitter.com/reshamas">@reshamas</a> / {today}&lt;br&gt;Source: JHU CSSE&quot;)<br>    , showarrow=False<br>    , x = 0<br>    , y = -0.15<br>    , xref=&#39;paper&#39;<br>    , yref=&#39;paper&#39; <br>    , xanchor=&#39;left&#39;<br>    , yanchor=&#39;bottom&#39;<br>    , xshift=-1<br>    , yshift=-5<br>    , font=dict(size=10, color=&quot;grey&quot;)<br>    , align=&quot;left&quot;<br>    ,<br>    )</pre><pre># add annotation text with an arrow<br>fig.add_annotation(<br>    x=&#39;2020-02-01&#39;<br>    , y=145+1<br>    , text=f&#39;145 is the&lt;br&gt;the maximum value&#39;<br>    , yanchor=&#39;bottom&#39;<br>    , showarrow=True<br>    , arrowhead=1<br>    , arrowsize=1<br>    , arrowwidth=2<br>    , arrowcolor=&quot;#636363&quot;<br>    , ax=-20<br>    , ay=-30<br>    , font=dict(size=12, color=&quot;purple&quot;, family=&quot;Courier New, monospace&quot;)<br>    , align=&quot;left&quot;<br>    ,)</pre><pre># add annotation with box, color-filled with opacity option<br>fig.add_annotation(<br>    x=&#39;2020-05-01&#39;<br>    , y=135<br>    , text=f&#39;May&lt;br&gt;Day&#39;<br>    , yanchor=&#39;bottom&#39;<br>    , showarrow=True<br>    , arrowhead=1<br>    , arrowsize=1<br>    , arrowwidth=2<br>    , arrowcolor=&quot;#636363&quot;<br>    , ax=-20<br>    , ay=-30<br>    , font=dict(size=20, color=&quot;green&quot;, family=&quot;Courier New, monospace&quot;)<br>    , align=&quot;left&quot;<br>    , bordercolor=&#39;green&#39;<br>    , borderwidth=2<br>    , bgcolor=&quot;#CFECEC&quot;<br>    , opacity=0.8<br>    ,)</pre><pre>fig.show()</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplotly.com%2F%7Ereshamas%2F35.embed%3Fautosize%3Dtrue&amp;display_name=Plotly&amp;url=http%3A%2F%2Fchart-studio.plotly.com%2F%7Ereshamas%2F35%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=plotly" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/1c73665cc0eb61a690fc2b6cd1297e01/href">https://medium.com/media/1c73665cc0eb61a690fc2b6cd1297e01/href</a></iframe><p><strong>Tip:</strong> there are many options for how text in annotations can be presented. There are options for font size, type and color. There are options for adding boxes around text with various formatting options. Arrows can be shown or hidden, using the showarrow=True option.</p><p><strong>Tip</strong>: the location of the annotation “145 is the maximum value” can be placed using the coordinates, in this case, x=&#39;2020-02-01&#39; and y=145. The location of the text can also be shifted using ax=-20 and ay=-30, as an example.</p><p><strong>Tip</strong>: multiple annotations can be layered on the graph by adding fig.add_annotation object.</p><h3>STEP 6: Add an annotation with vertical lines</h3><pre>fig = px.line(<br>    df<br>    , x=&#39;event_date&#39;<br>    , y=&#39;outcome&#39;<br>    , title = &quot;Event Data Over Time for Two Groups&quot;<br>    , color=&quot;groupid&quot;<br>    , range_x=[&#39;2019-12-01&#39;, &#39;2020-11-01&#39;],<br>)<br>fig.update_layout(<br>    autosize=False,<br>    width=800,<br>    height=600,)</pre><pre>fig.add_annotation(<br>    x=&#39;2020-03-21&#39;<br>    , y=145+1<br>    , text=f&#39;Mar 21&lt;br&gt;First day of spring&#39;<br>    , yanchor=&#39;bottom&#39;<br>    , showarrow=False<br>    , arrowhead=1<br>    , arrowsize=1<br>    , arrowwidth=2<br>    , arrowcolor=&quot;#636363&quot;<br>    , ax=-20<br>    , ay=-30<br>    , font=dict(size=12, color=&quot;orange&quot;, family=&quot;Sans Serif&quot;)<br>    , align=&quot;left&quot;<br>    ,)</pre><pre>fig.add_annotation(<br>    x=&#39;2020-06-21&#39;<br>    , y=145+1<br>    , text=f&#39;Jun 21&lt;br&gt;First day of summer&#39;<br>    , yanchor=&#39;bottom&#39;<br>    , showarrow=False<br>    , arrowhead=1<br>    , arrowsize=1<br>    , arrowwidth=2<br>    , arrowcolor=&quot;#636363&quot;<br>    , ax=-20<br>    , ay=-30<br>    , font=dict(size=12, color=&quot;purple&quot;, family=&quot;Sans Serif&quot;)<br>    , align=&quot;left&quot;<br>    ,)</pre><pre># add vertical lines<br>fig.update_layout(shapes=<br>                  [dict(type= &#39;line&#39;,<br>                        yref= &#39;paper&#39;, y0= 0, y1= 1,<br>                        xref= &#39;x&#39;, x0=&#39;2020-03-21&#39;, x1=&#39;2020-03-21&#39;,<br>                        line=dict(color=&quot;MediumPurple&quot;,<br>                                  width=3,<br>                                  dash=&quot;dot&quot;)<br>                        ),<br>                  dict(type= &#39;line&#39;,<br>                        yref= &#39;paper&#39;, y0= 0, y1= 1,<br>                        xref= &#39;x&#39;, x0=&#39;2020-06-21&#39;, x1=&#39;2020-06-21&#39;,<br>                        line=dict(color=&quot;MediumPurple&quot;,<br>                                  width=3,<br>                                  dash=&quot;solid&quot;)<br>                       )<br>                  ])<br>       <br>fig.show()</pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplotly.com%2F%7Ereshamas%2F37.embed%3Fautosize%3Dtrue&amp;display_name=Plotly&amp;url=https%3A%2F%2Fchart-studio.plotly.com%2F%7Ereshamas%2F37%2F&amp;image=https%3A%2F%2Fchart-studio.plotly.com%2Fstatic%2Fwebapp%2Fimages%2Fplotly-logo.8d56a320dbb8.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=plotly" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/972d74b912a5be4cdd2f32aaca24afe6/href">https://medium.com/media/972d74b912a5be4cdd2f32aaca24afe6/href</a></iframe><p><strong>Tip</strong>: the line type may be adjusted by using these options:</p><pre>dash=&quot;dot&quot; <br>dash=&quot;solid&quot;</pre><p><strong>Tip</strong>: multiple reference lines can be added using fig.update_layout(shapes=... and the lines can be added as a dictionary.</p><h3>STEP 7: Add vertical &amp; horizontal rectangle highlight sections</h3><pre>fig = px.line(<br>    df<br>    , x=&#39;event_date&#39;<br>    , y=&#39;outcome&#39;<br>    , title = &quot;Event Data Over Time for Two Groups&quot;<br>    , color=&quot;groupid&quot;<br>    , range_x=[&#39;2019-12-01&#39;, &#39;2020-11-01&#39;],<br>)<br>fig.update_layout(<br>    autosize=False,<br>    width=800,<br>    height=600,)</pre><pre>fig.add_annotation(<br>    x=&#39;2020-03-21&#39;<br>    , y=145+1<br>    , text=f&#39;Mar 21&lt;br&gt;First day of spring&#39;<br>    , yanchor=&#39;bottom&#39;<br>    , showarrow=False<br>    , arrowhead=1<br>    , arrowsize=1<br>    , arrowwidth=2<br>    , arrowcolor=&quot;#636363&quot;<br>    , ax=-20<br>    , ay=-30<br>    , font=dict(size=12, color=&quot;orange&quot;, family=&quot;Sans Serif&quot;)<br>    , align=&quot;left&quot;<br>    ,)</pre><pre>fig.add_annotation(<br>    x=&#39;2020-06-07&#39;<br>    , y=145+1<br>    , text=f&#39;Jun 21&lt;br&gt;First day&lt;br&gt;of summer&#39;<br>    , yanchor=&#39;bottom&#39;<br>    , showarrow=False<br>    , arrowhead=1<br>    , arrowsize=1<br>    , arrowwidth=2<br>    , arrowcolor=&quot;#636363&quot;<br>    , ax=-20<br>    , ay=-30<br>    , font=dict(size=12, color=&quot;purple&quot;, family=&quot;Sans Serif&quot;)<br>    , align=&quot;left&quot;<br>    ,)</pre><pre># add vertical lines<br>fig.update_layout(shapes=<br>                  [dict(type= &#39;line&#39;,<br>                        yref= &#39;paper&#39;, y0= 0, y1= 1,<br>                        xref= &#39;x&#39;, x0=&#39;2020-03-21&#39;, x1=&#39;2020-03-21&#39;,<br>                        line=dict(color=&quot;MediumPurple&quot;,<br>                                  width=3,<br>                                  dash=&quot;dot&quot;)<br>                        ),<br>                  dict(type= &#39;line&#39;,<br>                        yref= &#39;paper&#39;, y0= 0, y1= 1,<br>                        xref= &#39;x&#39;, x0=&#39;2020-06-21&#39;, x1=&#39;2020-06-21&#39;,<br>                        line=dict(color=&quot;MediumPurple&quot;,<br>                                  width=3,<br>                                  dash=&quot;solid&quot;)<br>                       )<br>                  ])</pre><pre># In United States: &#39;unofficial&#39; summer is from Memorial Day to Labor Day</pre><pre># Make a vertical highlight section<br>fig.add_vrect(x0=&quot;2020-05-25&quot;, x1=&quot;2020-09-07&quot;, <br>              annotation_text=&quot;Unofficial&lt;br&gt;Summertime&lt;br&gt;in USA&lt;br&gt;(Memorial Day to&lt;br&gt;Labor Day)&quot;, annotation_position=&quot;top right&quot;,  <br>              annotation_font_size=11,<br>              annotation_font_color=&quot;Green&quot;,<br>              fillcolor=&quot;yellow&quot;, opacity=0.25, line_width=0)</pre><pre># Make a horizontal highlight section<br>fig.add_hrect(y0=90, y1=100, <br>              annotation_text=&quot;Observed data&lt;br&gt;of interest&quot;, annotation_position=&quot;top right&quot;,  <br>              annotation_font_size=11,<br>              annotation_font_color=&quot;Black&quot;,<br>              fillcolor=&quot;red&quot;, opacity=0.25, line_width=0)</pre><pre>fig.show()<br></pre><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fplotly.com%2F%7Ereshamas%2F39.embed%3Fautosize%3Dtrue&amp;display_name=Plotly&amp;url=https%3A%2F%2Fchart-studio.plotly.com%2F%7Ereshamas%2F39%2F&amp;image=https%3A%2F%2Fchart-studio.plotly.com%2Fstatic%2Fwebapp%2Fimages%2Fplotly-logo.8d56a320dbb8.png&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=plotly" width="600" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/3fd390233233505aac412dff0cc64c8c/href">https://medium.com/media/3fd390233233505aac412dff0cc64c8c/href</a></iframe><p><strong>Tip</strong>: the horizontal and vertical highlight blocks can be created by adding an annotation section fig.add_hrect or fig.add_vrect. For the horizontal section, specify at which coordinates of y to place the blocks. The same can be done for the vertical highlight block, where x coordinates can be specified. The color of the highlight rectangle sections can be specified using the fillcolor option.</p><h3>Resources</h3><ul><li><a href="https://plotly.com/python/">Plotly Python Documentation</a></li><li><a href="https://community.plotly.com/">Plotly Community Forum</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6127ff6e0f80" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nerd-for-tech/enriching-data-visualizations-with-annotations-in-plotly-using-python-6127ff6e0f80">Enriching Data Visualizations with Annotations in Plotly using Python</a> was originally published in <a href="https://medium.com/nerd-for-tech">Nerd For Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Python pandas: Quick Tips]]></title>
            <link>https://medium.com/nerd-for-tech/python-pandas-quick-tips-e4e4866e1e14?source=rss-5ad813ef7ce0------2</link>
            <guid isPermaLink="false">https://medium.com/p/e4e4866e1e14</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[pandas-dataframe]]></category>
            <category><![CDATA[pandas]]></category>
            <dc:creator><![CDATA[Reshama Shaikh]]></dc:creator>
            <pubDate>Thu, 05 Aug 2021 15:57:30 GMT</pubDate>
            <atom:updated>2021-08-14T23:10:15.674Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/288/1*tHE3Xbwo_tP436lhP9I2jA.png" /></figure><h3>About</h3><p>These are the some of the most commonly used commands I use in pandas, shared here for easy reference. These example uses <strong>python version 3.9</strong> and <a href="https://pypi.org/project/pandas/"><strong>pandas version</strong></a><strong> 1.3.0</strong>.</p><h3>1) Download a `csv` file using `wget`</h3><pre># import libraries<br>from pathlib import Path<br>import pandas as pd</pre><pre># create directories, if they don&#39;t already exist<br>Path(&quot;data_raw&quot;).mkdir(parents=True, exist_ok=True)<br>Path(&quot;data_derived&quot;).mkdir(parents=True, exist_ok=True)</pre><pre># assign variable names to the directories<br>path_datain = &quot;data_raw/&quot;<br>path_dataout = &quot;data_derived/&quot;</pre><pre>data_url = &quot;<a href="https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series">https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_time_series</a>&quot;<br>file_name = &quot;time_series_covid19_confirmed_global.csv&quot;</pre><pre>file_url = data_url + &quot;/&quot; + file_name</pre><pre># get the file<br>!wget -N {file_url} -P {path_datain}</pre><pre>df = pd.read_csv(path_datain + file_name)</pre><h4>Look at dataframe</h4><pre><strong>df.head()</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gm5yVd7oZuC1lWkB9tXMGQ.png" /></figure><h3>2) Read in a `.csv` file and create a dataframe</h3><pre>df = <strong>pd.read_csv</strong>(path_datain + file_name)</pre><h3>3) Make a copy of a dataframe</h3><pre>df2 = <strong>df.copy()</strong></pre><h3>4) Explore a dataframe</h3><h4>Read in data</h4><pre>import pandas as pd<br>  <br># Creating the dataframe <br>df = pd.DataFrame({&quot;A&quot;:[2, 4, 6, None],<br>                   &quot;country&quot;:[&quot;India&quot;, &quot;Italy&quot;, &quot;Kenya&quot;, &quot;Unknown&quot;],<br>                   &quot;C&quot;:[10, 9, 8, 7],<br>                   &quot;D&quot;:[1, 3, None, 5],<br>                   &quot;E&quot;:[&#39;2020-01-01&#39;, &#39;2020-01-02&#39;,&#39;2020-01-03&#39;, &#39;NaN&#39;]})</pre><h4>Get dimensions of dataframe (# rows, # columns)</h4><pre><strong>df.shape()</strong></pre><p>(5,5)</p><h4>Get info</h4><pre><strong>df.info()</strong></pre><h4>&gt;output</h4><pre>&lt;class &#39;pandas.core.frame.DataFrame&#39;&gt;<br>RangeIndex: 5 entries, 0 to 4<br>Data columns (total 5 columns):<br> #   Column   Non-Null Count  Dtype  <br>---  ------   --------------  -----  <br> 0   A        4 non-null      float64<br> 1   country  5 non-null      object <br> 2   C        5 non-null      int64  <br> 3   D        4 non-null      float64<br> 4   E        5 non-null      object <br>dtypes: float64(2), int64(1), object(2)<br>memory usage: 328.0+ bytes</pre><h4>Get unique occurrences of a variable in a dataframe</h4><pre>import pandas as pd<br>  <br># Creating the dataframe <br>df = pd.DataFrame({&quot;A&quot;:[2, 4, 6, None],<br>                   &quot;country&quot;:[&quot;India&quot;, &quot;Italy&quot;, &quot;Kenya&quot;, &quot;India&quot;],<br>                   &quot;C&quot;:[10, 9, 8, 7],<br>                   &quot;D&quot;:[1, 3, None, 5],<br>                   &quot;E&quot;:[&#39;2020-01-01&#39;, &#39;2020-01-02&#39;,&#39;2020-01-03&#39;, &#39;NaN&#39;]})</pre><pre><strong>df[&#39;country&#39;].unique()</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*fKtZcAuejxLNqbtyW8dqYA.png" /></figure><h4>Get frequency counts for a variable in a dataframe</h4><pre>df[&#39;country&#39;]<strong>.value_counts(normalize=False)</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*oSOUwN8HLWVpsMOI-0ru4w.png" /></figure><p>NOTE: Use normalize=True to obtain percents.</p><h3>5) Keep a subset of variables (columns), using `filter`</h3><pre>import pandas as pd<br>  <br># Creating the dataframe <br>df = pd.DataFrame({&quot;A&quot;:[2, 4, 6],<br>                   &quot;B&quot;:[1, 2, 3],<br>                   &quot;C&quot;:[10, 9, 8],<br>                   &quot;D&quot;:[1, 3, None]<br>})</pre><pre><strong>keep_cols = [&#39;A&#39;, &#39;B&#39;]</strong></pre><pre><strong>df_v2 = df.filter(keep_cols)</strong></pre><h3>6) “Drop” one or multiple variables in a dataframe</h3><pre>import pandas as pd<br>  <br># Creating the dataframe <br>df = pd.DataFrame({&quot;A&quot;:[2, 4, 6],<br>                   &quot;B&quot;:[1, 2, 3],<br>                   &quot;C&quot;:[10, 9, 8],<br>                   &quot;D&quot;:[1, 3, None]<br>})</pre><pre>df</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/278/1*dQ5qxr1rb1D14qatcViBQw.png" /></figure><pre><strong>drop_cols = [&#39;A&#39;, &#39;B&#39;]</strong></pre><pre><strong>df.drop(drop_cols, axis=1, inplace=True)</strong></pre><pre>df</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/206/1*Vvhav-h92J8Gz6NlKhLMqw.png" /></figure><h3>7) Take subset of rows in a dataframe: using `isin`</h3><pre>import pandas as pd<br>  <br># Creating the dataframe <br>df = pd.DataFrame({&quot;A&quot;:[2, 4, 6],<br>                   &quot;B&quot;:[1, 2, 3],<br>                   &quot;C&quot;:[10, 9, 8],<br>                   &quot;D&quot;:[1, 3, None]<br>})</pre><pre>df</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/278/1*8pEUoU_QElQopZ1jbli2OA.png" /></figure><pre><strong>filtered_list = [2, 4]</strong></pre><pre><strong>check1 = df[df[&quot;A&quot;].isin(filtered_list)]</strong></pre><pre>check1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/272/1*jtz8UIgFaAEbmgBhKKgLSA.png" /></figure><h3>8) Re-order columns</h3><pre>import pandas as pd<br>  <br># Creating the dataframe <br>df = pd.DataFrame({&quot;A&quot;:[2, 4, 6],<br>                   &quot;B&quot;:[1, 2, 3],<br>                   &quot;C&quot;:[10, 9, 8],<br>                   &quot;D&quot;:[1, 3, None]<br>})</pre><pre><strong>df.head(2)</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/1*5x2Q9mWQLsXMQyRSdGydhg.png" /></figure><pre><strong>new_order = [&#39;D&#39;, &#39;A&#39;, &#39;C&#39;, &#39;B&#39;]</strong></pre><pre><strong>df_new = df.reindex(new_order, axis=1)</strong></pre><pre>df_new.head(2)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/260/1*90DexGYln8dL6ifhBop6mQ.png" /></figure><h3>9) Rename columns in a dataframe</h3><pre>import pandas as pd<br>  <br># Creating the dataframe <br>df = pd.DataFrame({&quot;A&quot;:[120, 140, 100],<br>                   &quot;B&quot;:[80, 90, 60],<br>                   &quot;C&quot;:[10, 9, 8],<br>                   &quot;D&quot;:[1, 3, None]<br>})</pre><pre>df</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/302/1*mhQa-rLcYznP2JQXj7XB4Q.png" /></figure><pre><strong>df = df.rename(columns={&#39;A&#39;: &#39;systolic&#39;,<br>                        &#39;B&#39;: &#39;diastolic&#39;<br>                       })</strong></pre><pre>df</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/404/1*8HpX37gtnw1dThWFxBSOXw.png" /></figure><h3>10) Transpose a dataframe (pivot table); Use `melt`</h3><pre># importing pandas as pd<br>import pandas as pd<br>  <br># Creating the dataframe <br>df = pd.DataFrame({&quot;country&quot;:[&quot;India&quot;, &quot;USA&quot;, &quot;Mongolia&quot;],<br>                   &quot;year&quot;: [2019, 2020, 2021],<br>                   &quot;A&quot;:[10, 9, 8],<br>                   &quot;B&quot;:[1, 3, None],<br>                   &quot;C&quot;:[&#39;2020-01-01&#39;, &#39;2018-01-01&#39;, &#39;NaN&#39;]})</pre><pre>df</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/506/1*Nh8EzqGuhRISkptkMSNo2w.png" /></figure><pre>df_long = <strong>df.melt(id_vars=[&#39;country&#39;, &#39;year&#39;])</strong></pre><pre>df_long</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*mNzRmIoDSj3dRj3i0zJ43Q.png" /></figure><h3>11) Write out a dataframe to a `.csv` file</h3><pre># Takes dataframe &quot;df&quot; and writes it out a csv file named &quot;report.csv&quot;</pre><pre><strong>df.to_csv</strong>(&#39;data_derived/report.csv&#39;)</pre><h3>12) Using `mask` to assign new data values</h3><pre># importing pandas as pd<br>import pandas as pd<br>  <br># Creating the dataframe <br>df = pd.DataFrame({&quot;A&quot;:[2, 4, None],<br>                   &quot;country&quot;:[&quot;India&quot;, &quot;USA&quot;, &quot;Unknown&quot;],<br>                   &quot;C&quot;:[10, 9, 8],<br>                   &quot;D&quot;:[1, 3, None],<br>                   &quot;event_date&quot;:[&#39;2020-01-01&#39;, &#39;2018-01-01&#39;, &#39;NaN&#39;]})</pre><pre>df</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/510/1*YZKVPFwonJuqhLNBo0iNJA.png" /></figure><p>Changing an existing column</p><pre># IF the event_date=&#39;2018-01-01&#39;, then assign country (existing column in df) to be &quot;United States&quot;</pre><pre><strong>df[&#39;country&#39;].mask(df[&#39;event_date&#39;] == &#39;2018-01-01&#39;, &#39;United States&#39;, inplace=True)</strong></pre><pre>df</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/544/1*C4Ko6S8B8D5GTM0fim6yhQ.png" /></figure><p>Creating a new column</p><pre># IF the event_date=&#39;2018-01-01&#39;, then assign chapter_status (a new column) to be &quot;unbegun&quot;</pre><pre># NOTE:  the new column needs to be initialized</pre><pre><strong>df[&#39;chapter_status&#39;] = &quot;&quot;</strong></pre><pre><strong>df[&#39;chapter_status&#39;].mask(df[&#39;event_date&#39;] == &#39;2018-01-01&#39;, &#39;unbegun&#39;, inplace=True)</strong></pre><pre>df</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*RfjjIdBXizMp150_zQ_0RA.png" /></figure><h3>13) Convert from character to integer</h3><pre># importing pandas as pd<br>import pandas as pd<br>  <br># Creating the dataframe <br>df = pd.DataFrame({&quot;A&quot;:[12, 4, 5, None],<br>                   &quot;B&quot;:[7, 2, 54, 3],<br>                   &quot;C&quot;:[20, 16, 11, 3],<br>                   &quot;D&quot;:[14.3, 3.5, 5.0, 6.8]})</pre><pre>df.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/306/1*p127DiA2JnMG49YBevilzQ.png" /></figure><pre><strong>df[&#39;D_n&#39;]= df[&#39;D&#39;].astype(int)</strong></pre><pre>df.head()</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/364/1*lYmGrCDhy8PHvjpI8wl3xA.png" /></figure><h3>14) Replace “NaN” with another value</h3><pre># importing pandas as pd<br>import pandas as pd<br>  <br># Creating the dataframe <br>df = pd.DataFrame({&quot;A&quot;:[12, 4, 5, None, 1],<br>                   &quot;B&quot;:[7, 2, 54, 3, None],<br>                   &quot;C&quot;:[20, 16, 11, 3, 8],<br>                   &quot;D&quot;:[14, 3, None, 2, 6]})</pre><pre>df.head()</pre><figure><img alt="table of numbers with 5 columns and 4 rows, 3 places contain a N-a-N value" src="https://cdn-images-1.medium.com/max/332/1*cJmkh8sJ2Y3y0TAO0I6d0w.png" /></figure><pre># replace the NaN values with 1000</pre><pre><strong>df.mask(df.isna(), 1000)</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*hDFWVO0IUwLTqdvHJcVrLg.png" /></figure><pre># NOTE: use inplace=True, so it is permanently replaced in the dataframe. </pre><pre>df.mask(df.isna(), 1000, <strong>inplace=True</strong>)</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e4e4866e1e14" width="1" height="1" alt=""><hr><p><a href="https://medium.com/nerd-for-tech/python-pandas-quick-tips-e4e4866e1e14">Python pandas: Quick Tips</a> was originally published in <a href="https://medium.com/nerd-for-tech">Nerd For Tech</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tema Okun]]></title>
            <link>https://blog.jupyter.org/tema-okun-a7e5f1f0cd05?source=rss-5ad813ef7ce0------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7e5f1f0cd05</guid>
            <category><![CDATA[accomplice]]></category>
            <category><![CDATA[diversity-and-inclusion]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[racism]]></category>
            <dc:creator><![CDATA[Reshama Shaikh]]></dc:creator>
            <pubDate>Mon, 12 Oct 2020 16:21:03 GMT</pubDate>
            <atom:updated>2020-11-27T15:05:53.590Z</atom:updated>
            <content:encoded><![CDATA[<p><em>JupyterCon 2020 keynote speaker announcement</em></p><h3>JupyerCon Keynote Talk</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fi0DsD0xjSPM%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Di0DsD0xjSPM&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fi0DsD0xjSPM%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/6869d609eb00f522e5bd04c45d9ec76e/href">https://medium.com/media/6869d609eb00f522e5bd04c45d9ec76e/href</a></iframe><h3>Tackling Toxic Culture in Tech: Racism and Its Legacy</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/347/1*WUZj93A-VftEeOJiaouFOA.jpeg" /><figcaption><a href="https://twitter.com/temaokun">Tema Okun</a></figcaption></figure><p>Tema Okun has spent over 30 years working with and for organizations, schools, and community-based institutions as a trainer, facilitator, and coach focused on issues of racial justice and equity. Dr. Okun currently co-leads the Teaching for Equity Fellows Program at Duke University, which works with faculty seeking to develop stronger skills both teaching about race and racism and across lines of race, class, and gender. She also facilitates, coaches, and consults with leaders and organizations nationwide.</p><p>Tema was a member of the Educational Leadership faculty at National Louis University in Chicago and has taught undergraduate, master’s, and doctoral level students in educational leadership and education. She is the author of the award-winning <a href="https://www.infoagepub.com/products/The-Emperor-Has-No-Clothes">The Emperor Has No Clothes: Teaching About Race and Racism to People Who Don’t Want to Know</a> (2010, IAP) and the widely used article <a href="https://www.dismantlingracism.org/uploads/4/3/5/7/43579015/okun_-_white_sup_culture.pdf">White Supremacy Culture</a>. She publishes regularly on the pedagogy of racial and social justice.</p><p>Tema is a participant in the Living School for Action and Contemplation and a member of the Bhumisphara Sangha under the leadership of Lama Rod Owens. She is an artist, a poet, and a writer. She lives in Durham NC where she is fortunate to reside among beloved community. Her current project is deepening her ability to love her neighbor as herself. She is finding the instruction easy and the follow through challenging, given how we live in a culture that is afraid to help us do either or both.</p><h3>Tema Okun at JupyterCon 2020</h3><p>Three years ago, I was searching for career advice and discovered the <a href="https://www.xeniumhr.com/blog/podcast/hrsb/podcast-how-to-manage-conflict-in-the-workplace/">Transform Your Workplace podcast</a> with Brandon Laws and Megan Leatherman. I connected with Megan Leatherman and signed up for her <a href="http://awildnewwork.com/">newsletter</a>. In Megan’s June 2020 newsletter, she included a reference to <a href="https://www.stitcher.com/podcast/unleashing-social-change/e/66722588">Tema’s podcast</a> which really resonated with me.</p><p>The JupyterCon leadership had a vision for this conference to invite us to come together as a community, and think how we can make it better. We have strived to focus our attention on diversity and inclusion in all aspects of our programming. We also decided to accentuate equity and social justice in a dedicated keynote speech, and we are delighted to host Tema Okun in this role.</p><h3>Book</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/288/1*vqs1Rj8BzZcOpQY-DTzbRw.png" /></figure><h3>Podcasts</h3><h4><a href="https://www.michellecjohnson.com/finding-refuge-podcast/2020/9/28/04-love-amp-humility">Love and Humility: Finding Refuge</a> (Sep 2020)</h4><p><a href="https://www.michellecjohnson.com/finding-refuge-podcast/2020/9/28/04-love-amp-humility">04. Love &amp; Humility - Michelle Johnson</a></p><h4>White Supremacy Culture at Work (Jul 2020)</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fart19.com%2Fshows%2Fliving-corporate%2Fepisodes%2Fce2c3fe2-9eb5-4d41-8e22-7fd8c9e0c980%2Fembed&amp;display_name=ART19&amp;url=https%3A%2F%2Fart19.com%2Fshows%2Fliving-corporate%2Fepisodes%2Fce2c3fe2-9eb5-4d41-8e22-7fd8c9e0c980&amp;image=https%3A%2F%2Fcontent.production.cdn.art19.com%2Fimages%2Fcc%2Fe7%2Fca%2Fbc%2Fcce7cabc-79e3-45f7-8722-abfa65d6ca58%2Ff8d75318f46ba1d6e60a95d0fe532e26a40a946646b47762ec98879f6f69b60046ba8abbca2e7aa83ade5fd1f7b5c28ca203f0079376263c4dc748ea5619fd81.jpeg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=art19" width="720" height="200" frameborder="0" scrolling="no"><a href="https://medium.com/media/94c808af2e16f05b233fe7b26fffc6c3/href">https://medium.com/media/94c808af2e16f05b233fe7b26fffc6c3/href</a></iframe><h4><a href="https://www.stitcher.com/podcast/unleashing-social-change/e/66722588">Unleashing Social Change: Tema Okun</a> (Jan 2020)</h4><p><a href="https://www.stitcher.com/podcast/unleashing-social-change/e/66722588">Unleashing Social Change</a></p><h3></h3><p>Episode 18: Tema Okun, Duke University, &quot;Facing Into Your Own Racism with Courage and Love&quot; https://t.co/lVTXLvb61h</p><h3></h3><p>@karaswisher: must have Tema Okun on your podcast:Racial justice/equity is built on idea of including people of color into a white world, w/the idea that &quot;we help them&quot;.There is very little investigation of the &quot;white world&quot; &amp; the toxicity of whiteness.</p><h3>Resources</h3><p><a href="https://www.dismantlingracism.org">Dismantling Racism</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7e5f1f0cd05" width="1" height="1" alt=""><hr><p><a href="https://blog.jupyter.org/tema-okun-a7e5f1f0cd05">Tema Okun</a> was originally published in <a href="https://blog.jupyter.org">Jupyter Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[UADS: Time Series Modeling]]></title>
            <link>https://medium.com/@reshamas/uads-time-series-modeling-e74747d944d7?source=rss-5ad813ef7ce0------2</link>
            <guid isPermaLink="false">https://medium.com/p/e74747d944d7</guid>
            <category><![CDATA[pandas]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[fourier-transform]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[time-series-analysis]]></category>
            <dc:creator><![CDATA[Reshama Shaikh]]></dc:creator>
            <pubDate>Sun, 08 Mar 2020 13:08:51 GMT</pubDate>
            <atom:updated>2020-08-20T13:55:14.352Z</atom:updated>
            <content:encoded><![CDATA[<h3>[Data Umbrella] Time Series Modeling: Machine Learning Approaches with Python</h3><p>“URGs and Allies in Data Science” held our second event on March 7, 2020 at <a href="https://www.farfetch.com/">Farfetch</a> in New York City. About 55 people attended.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*CHOWEiYKKYdrdIUXAkJLhg.png" /></figure><h3>Speaker</h3><p><a href="https://twitter.com/bgoncalves">Bruno Goncalves</a></p><p>Website: <a href="http://www.data4sci.com/">www.data4sci.com</a><br>Newsletter: <a href="http://www.data4sci.com/newsletter">www.data4sci.com/newsletter</a></p><h3>Workshop</h3><p>Time series are everywhere around us. Understanding them requires taking into account the sequence of values seen in previous steps and even long-term temporal correlations. Bruno Goncalves explains a broad range of traditional machine learning (ML) and deep learning techniques to model and analyze time series datasets with an emphasis on practical applications.</p><p>Bruno will be presenting a 2-day workshop at an upcoming event:</p><ul><li>O’Reilly <a href="https://conferences.oreilly.com/strata-data-ai/stai-ny">Strata Data and AI</a> Conference (New York, NY) (Sep 2020)</li></ul><h3>Workshop GitHub Repo</h3><ul><li><a href="https://github.com/DataForScience/Timeseries_long">Timeseries_long</a></li></ul><h3>Related Links</h3><p>Meetup event: <a href="https://www.meetup.com/nyc-uads/events/268766867/">Time Series Modeling: ML and Deep Learning Approaches with Python</a></p><h3>Job Postings at Farfetch</h3><p>These are current openings in New York City.</p><ul><li><a href="https://farfetchcareers.com/job-detail/senior-software-engineer-(python)">Senior Software Engineer</a></li><li><a href="https://farfetchcareers.com/job-detail/senior-data-scientist">Senior Data Scientist</a></li></ul><h3>Acknowledgments</h3><ul><li><a href="https://www.linkedin.com/in/noemiderzsy/">Noemi Derzsy</a> (UADS organizer)</li><li>Farfetch (our venue host)</li><li><a href="https://www.linkedin.com/in/jazzmin-may-carroll-42a52341/">Jazzmin Carroll </a>(Farfetch)</li><li><a href="https://www.linkedin.com/in/alice-sieger-6879524/">Alice Sieger</a> (Farfetch)</li><li><a href="https://www.linkedin.com/in/sedine-baldeo-143960161/">Sedine Baldeo</a> (Farfetch)</li><li><a href="https://www.linkedin.com/in/ankurrajdev/">Ankur Rajdev</a> (Farfetch)</li><li><a href="https://twitter.com/HeyIamGianluca">Gianluca Rossi</a> (Farfetch)</li><li><a href="https://www.linkedin.com/in/shaikht/">Ty Shaikh</a> (UADS photography)</li></ul><h3>Social Media</h3><h3>URGs and Allies in Data Science on Twitter</h3><p>We&#39;ve all wondered at one time or another: How do I handle time series data❓ 👉🏽Join us for a workshop with @bgoncalves to find out. 🗓️ Mar 7 (Saturday) 🕘 9am to 4pm 📍 @farfetch 🌐 New York, NY #python #DataScience Sign up here: https://t.co/gTl6EuQMrg</p><h3>Gianluca Rossi on Twitter</h3><p>I can&#39;t wait to meet you all at this @urgsADS event about Time Series modeling at our office in New York! #MachineLearning #DataScience #python https://t.co/2YsisBI3bz</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e74747d944d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[UADS: Bayesian Data Science by Simulation]]></title>
            <link>https://medium.com/@reshamas/uads-bayesian-data-science-by-simulation-a78d5130f02a?source=rss-5ad813ef7ce0------2</link>
            <guid isPermaLink="false">https://medium.com/p/a78d5130f02a</guid>
            <category><![CDATA[bayesian]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[numpy]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Reshama Shaikh]]></dc:creator>
            <pubDate>Sun, 23 Feb 2020 01:46:13 GMT</pubDate>
            <atom:updated>2020-08-20T13:55:45.183Z</atom:updated>
            <content:encoded><![CDATA[<h3>Data Umbrella: Bayesian Data Science by Simulation</h3><p>“URGs and Allies in Data Science” held our inaugural event on Feburary 19, 2020 at Two Sigma in New York City.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*CrVJ2z2K4A1Wonb_j-dAbw.png" /></figure><h3>Speaker</h3><p><a href="https://twitter.com/hugobowne">Hugo Bowne-Anderson</a></p><h3>Workshop</h3><p>This tutorial was an Introduction to Bayesian data science through the lens of simulation or hacker statistics. The objective was to become familiar with many common probability distributions through i) matching them to real-world stories &amp; ii) simulating them. We worked with joint/conditional probabilities, Bayes Theorem, prior/posterior distributions and likelihoods, while seeing their applications in real-world data analyses. We saw the utility of Bayesian inference in parameter estimation and comparing groups and concluded with a dive into the wonderful world of probabilistic programming.</p><p>Hugo will be presenting an extended version of this workshop:</p><ul><li>April 20 to 21, 2020 at <a href="https://conferences.oreilly.com/strata-data-ai/stai-eu/public/schedule/detail/84385">Strata London</a></li><li>April 14, 2020 at <a href="https://odsc.com/speakers/bayesian-data-science-probabilistic-programming/">ODSC East Boston</a></li></ul><h3>GitHub repo</h3><ul><li><a href="https://github.com/ericmjl/bayesian-stats-modelling-tutorial/">Code + Binder</a></li><li><a href="https://github.com/ericmjl/bayesian-stats-modelling-tutorial/tree/master/notebooks/URGsADS-NYC-2020-02-19">Jupyter Notebooks</a></li></ul><h3><strong>Related links</strong></h3><ul><li>Meetup <a href="https://www.meetup.com/nyc-uads/events/268293679/">event listing</a></li></ul><h3>Acknowledgements</h3><p><a href="https://twitter.com/twosigma">Two Sigma</a></p><p><a href="https://twitter.com/JuliaEve">Julia Meinwald</a> (Two Sigma)</p><p>Alex Alekseyev (Two Sigma)</p><p><a href="https://www.linkedin.com/in/shaikht/">Ty Shaikh</a> (photography)</p><h3>Social Media</h3><h3>Arturo Castellanos on Twitter</h3><p>Super interesting workshop on Bayesian Data Science by Simulation with @hugobowne NYC URGs meetup @DataCamp @twosigma</p><h3>URGs and Allies in Data Science on Twitter</h3><p>Record turnout at our inaugural event ➡️➡️ such #DataScience passion in NYC! ⚡️ @hugobowne talks binomial, poisson, bayes, priors &amp;amp; more. Hosted at @twosigma Notebooks: https://t.co/V2aTsjSqC8 https://t.co/qO1tXH6gYg</p><h3>Hugo Bowne-Anderson on Twitter</h3><p>iIm really excited to be running a workshop on Bayesian stats, telling stories w/ simulation, probabilistic programming, &amp;amp; more at @urgsADS in February in NYC. Also really chuffed that @reshamas asked me to do so 😊 thanks for the opportunity! https://t.co/4fu4LgTzHp</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a78d5130f02a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[FAQs: Learning Python]]></title>
            <link>https://medium.com/@reshamas/faqs-learning-python-caf6849ea342?source=rss-5ad813ef7ce0------2</link>
            <guid isPermaLink="false">https://medium.com/p/caf6849ea342</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Reshama Shaikh]]></dc:creator>
            <pubDate>Wed, 05 Jun 2019 16:44:03 GMT</pubDate>
            <atom:updated>2021-08-12T19:04:17.434Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>What resources would you recommend for learning Python?</strong></p><p>A The below resources are the most popular and used widely. An added plus, there are no distracting ads on their sites.</p><p><strong>Introductory Blog</strong></p><ul><li><a href="https://www.freecodecamp.org/news/learning-python-from-zero-to-hero-120ea540b567/">Learning Python: From Zero to Hero</a> (quick read)</li></ul><p><strong>Free online tutorials</strong></p><ul><li><a href="https://automatetheboringstuff.com">Automate the Boring Stuff with Python</a> (online book)</li><li>HackerRank: <a href="https://www.hackerrank.com/domains/python">Python</a></li><li><a href="https://learntocodetogether.com/learn-python-the-hard-way-free-ebook-download/">Learn Python the Hard Way</a></li><li><a href="https://www.codecademy.com">CodeCademy</a></li><li>PyCharm: <a href="https://www.jetbrains.com/pycharm-edu/learners/">Introduction to Python</a></li></ul><h3><strong>Recommendations</strong></h3><h3>Sukriti Macker on Twitter: &quot;Top 5 FREE Python Courses on Udemy and Coursera!! 😍(Plus a BONUS resource! 🌟)Python Programming Resources 🧵👇 / Twitter&quot;</h3><p>Top 5 FREE Python Courses on Udemy and Coursera!! 😍(Plus a BONUS resource! 🌟)Python Programming Resources 🧵👇</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=caf6849ea342" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>