Power up the almost useless code suggestions in JupyterLab

Image for post
Image for post
JupyterLab’s native code completion is well….not great.

As a data scientist, you almost surely use a form of Jupyter Notebooks. Hopefully, you have moved over to the goodness of JupyterLab with its integrated sidebar, tabs, and more. When it first launched in 2018, JupyterLab was great but felt it was missing some things.

Now you can add a visual debugger and there is even a library called nbdev that allows you to author full Python packages and push them to PyPI. JupyterLab has become a complete IDE for data scientists. But one thing was still sub-optimal until recently, code completions.

Trying to use the built-in code completion in JupyterLab gets you something like…


Image for post
Image for post
A web app I made with Anvil to monitor air pollution in Ulaanbaatar, Mongolia.

Build a data science app in minutes, and deploy it to the web in one click.

Disclaimer: I’m not affiliated with Anvil, I just love their product.

As more data scientists enter organizations around the world, most will find a very different work environment than what they may have dreamed about at Netflix, Facebook, or Google. At these companies, data scientists are supported by data engineers, machine learning engineers, application developers, and dev-ops specialists. Instead, they will probably find themselves working in a small team, or even by themselves. This poses major issues when a data scientist wants to get their insights, models, and even products out of Jupyter and into production.

Anvil fills in these gaps by allowing you to build a full-stack web app using only Python. You can build a user interface with a simple drag and drop UI (or build it with code if you insist), plot with your favorite Python plotting library (Plotly, Matplotlib, etc.), and then deploy to the web in one click. No servers or containers to deal with. …


Image for post
Image for post

2020 Parliamentary Election

The current election saw a switch back to the block voting system used in 1992 and 2008. This system has both positives and negatives, and this system has much larger election districts than the previous single-member districts of the 2016 election. This allows us to more easily analyze the districts with the available data.

To put all of the data together and make it user friendly, I built Songolt, an interactive data explorer that allows the reader to see key indicators of election districts. The indicators covered in the app include:

  • Population indicators: population, household size, herder percent, age group…


Image for post
Image for post

Улаанбаатар хотын агаарын чанарыг харьцуулах апп

TL:DR Agaar.Mongol.ai нь Улаанбаатар хотын агаарын чанарыг өмнөх он жилүүдийн байдлыг харж, харьцуулах боломжийг олгож байгаа анхны Mongol.ai-ийн вэб аппликэйшн юм. Та энэхүү програмыг дараах хаягаар орон ашиглах боломжтой — http://agaar.mongol.ai

Улаанбаатар хотын агаарын чанар муу байгаа нь хүн бүхний зовниж байгаа асуудал бөгөөд өвлийн улиралд Улаанбаатар хот хамгийн муу агаарын чанартай хотуудын нэгт багтдаг. 2019 онд Монголын засгийн газар нь түүхий нүүрс түлэхийг хориглосон. Хэдийгээр үр дүн нь нааштай байсан ч агаарын бохирдлыг бүрэн шийдвэрлэх нь амаргүй даваа юм.

Бид Agaar.Mongol.ai-г олон нийтэд нээлттэй байлгаж, мөн энэхүү вэб аппликэйшнээр агаарын чанарын өмнөх он жилүүдийн мэдээллийг харж, хялбар аргаар харьцуулан дүгнэх боломжийг олгохоор шийдсэн юм. …


Image for post
Image for post

An app to compare Ulaanbaatar air quality

TL:DR Agaar.Mongol.ai is a free web app to view historic air quality data for Ulaanbaatar. It is the first app released by Mongol.ai. You can access the application at https://agaar.mongol.ai!

It’s no secret that poor air quality is a major challenge in Ulaanbaatar. Winter months can be so bad the city is regularly in the top 5 cities with the worst air quality. In 2019 the Mongolian government banned the burning of raw coal in Ulaanbaatar in an effort to reduce air pollution. Initial reports as to the effectiveness of this ban have been positive. …


Image for post
Image for post

4 different sources, 2 different methods

Air pollution is a big issue during the winter months in Ulaanbaatar, Mongolia. The effects of air pollution are quite severe, with those living in the most polluted areas suffering from lowered lung function, increased rates of respiratory infection, and shortened lifespans. In an attempt to solve this issue, the government has been focusing on the source of air pollution, the peri-urban ger districts surrounding the city center. In these areas, houses burn coal for both cooking and heat.

Beginning in May 2019, burning raw coal in Ulaanbaatar was made illegal. To replace the fuel the government coordinated the manufacture and supply of “enhanced charcoal briquettes”, which is supposed to reduce air pollution in Ulaanbaatar by 40–50%. …


Image for post
Image for post

4 different sources, 2 different methods

Air pollution is a big issue during the winter months in Ulaanbaatar, Mongolia. The effects of air pollution are quite severe, with those living in the most polluted areas suffering from lowered lung function, increased rates of respiratory infection, and shortened lifespans. In an attempt to solve this issue, the government has been focusing on the source of air pollution, the peri-urban ger districts surrounding the city center. In these areas, houses burn coal for both cooking and heat.

Beginning in May 2019, burning raw coal in Ulaanbaatar was made illegal. To replace the fuel the government coordinated the manufacture and supply of “enhanced charcoal briquettes”, which is supposed to reduce air pollution in Ulaanbaatar by 40–50%. …


Image for post
Image for post

It’s always good to remember the basics

In December 2018 I wrote an article forecasting the USD-MNT exchange rate using machine learning. The subtitle was “When a good model doesn’t work”, so keep this in mind as you read below. The model I developed had an average error of about 28 MNT when forecasting 3, 6, and 12 months ahead. This sounds pretty good, but the end of 2018 saw a large depreciation of the tugrik and our model forecast appeared to be well under the trend. So how did the model do? Let’s take a look!

Image for post
Image for post

Look at the difference! That’s a pretty bad forecast. It’s not much better than drawing a horizontal line from the forecast date. …


I put the new Sqair air purifier from Smart Air to the test in a controlled experiment

Image for post
Image for post

Winter is coming, and we know what that means in Ulaanbaatar. Extremely high levels of air pollution. Even with the recent ban on the burning of raw coal it is possible (even likely) that levels of the particularly dangerous pollutant PM2.5 will remain high during the winter months.

During these months a pollution mask and air purifier are essential equipment to protect yourself and your family. Air purifiers can cost anywhere from $150-$500 or more. This means many families choose to forgo air purifiers completely, at the cost of their entire families health. Smart Air, a social enterprise founded in 2013, wants to change this situation with the launch of their new no-nonsense air purifier, the Sqair. …


70 сая малтай улсад, махны үнэ өссөөр байна

For the English version of this article click here. You can find the data and Jupyter Notebook for this article on Github here.

Улаанбаатар хотод 2018 оны 9 сараас хойш 1 кг хонины махны дундаж үнэ 35 хувиар (үхрийн мах 26 хувиар) өссөн. Мэдээллийн эх сурвалжууд энэхүү үнийн өсөлт, хөөрөгдөл цаашлаад махны нөөц хомсдолын талаар ихээхэн сенсацалсан билээ. Хэвлэн нийтлэгчид ихэвчлэн “Тэнгэрт тулсан үнэ” хэмээх утга бүхий гарчигтай нийтлэлүүд бичсэн байлаа. (Ikon.mn-ы онцлох сонин өгүүллийг доороос үзнэ үү). Миний бие махны үнэ яагаад дээд цэгтээ хүрснийг зах зээлийн хүчин зүйлстэй холбон тайлбарлахыг оролдлоо.

Image for post
Image for post

Монголын Махны Зах Зээлийн Талаар

Image for post

Монголын хувьд махны үнэ нь улирлын чанартай бөгөөд хавар нь өсч намар нь буурах хандлагатай байдаг. Мах нийлүүлэлт нь нийт хүн амын 30 хувь болох малчдаас ирдэг. Гэвч малчдын мах нийлүүлэлтийн үйл явц нь барууны орнуудтай харьцуулахад харьцангуй өөр байдаг. Тэдний зан төлөв нь ихэвчлэн мал сүргийн эрүүл мэнд болон улирлын чанартай төрөл бүрийн сорилт, бэлтгэлээс хамаарч өөрчлөгддөг. …

About

Robert Ritz

Data Scientist and Director of LETU Mongolia. Keen observer of Mongolia.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store