<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Python on Squid's Blog</title><link>https://gigasquidsoftware.com/categories/python/</link><description>Recent content in Python on Squid's Blog</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Fri, 24 Jan 2020 15:34:00 +0000</lastBuildDate><atom:link href="https://gigasquidsoftware.com/categories/python/atom.xml" rel="self" type="application/rss+xml"/><item><title>Clojure Interop with Python NLP Libraries</title><link>https://gigasquidsoftware.com/blog/2020/01/24/clojure-interop-with-python-nlp-libraries/</link><pubDate>Fri, 24 Jan 2020 15:34:00 +0000</pubDate><guid>https://gigasquidsoftware.com/blog/2020/01/24/clojure-interop-with-python-nlp-libraries/</guid><description>&lt;p&gt;&lt;img alt="clojure-python" loading="lazy" src="http:////live.staticflickr.com/65535/49435394578_400fdf1c7f_c.jpg"&gt;&lt;/p&gt;
&lt;p&gt;In this edition of the blog series of Clojure/Python interop with &lt;a href="https://github.com/cnuernber/libpython-clj"&gt;libpython-clj&lt;/a&gt;, we&amp;rsquo;ll be taking a look at two popular Python NLP libraries: &lt;a href="https://www.nltk.org/"&gt;NLTK&lt;/a&gt; and &lt;a href="https://spacy.io/"&gt;SpaCy&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="nltk---natural-language-toolkit"&gt;NLTK - Natural Language Toolkit&lt;/h2&gt;
&lt;p&gt;I was taking requests for doing examples of python-clojure interop libraries on twitter the other day, and by &lt;em&gt;far&lt;/em&gt; NLTK was the most requested library. After looking into it, I can see why. It&amp;rsquo;s the most popular natural language processing library in Python and you will see it everywhere there is text someone is touching.&lt;/p&gt;</description></item><item><title>Parens for Pyplot</title><link>https://gigasquidsoftware.com/blog/2020/01/18/parens-for-pyplot/</link><pubDate>Sat, 18 Jan 2020 15:39:00 +0000</pubDate><guid>https://gigasquidsoftware.com/blog/2020/01/18/parens-for-pyplot/</guid><description>&lt;p&gt;&lt;a href="https://github.com/cnuernber/libpython-clj"&gt;libpython-clj&lt;/a&gt; has opened the door for Clojure to directly interop with Python libraries. That means we can take just about any Python library and directly use it in our Clojure REPL. But what about &lt;a href="https://matplotlib.org/"&gt;matplotlib&lt;/a&gt;?&lt;/p&gt;
&lt;p&gt;Matplotlib.pyplot is a standard fixture in most tutorials and python data science code. How do we interop with a python graphics library?&lt;/p&gt;
&lt;h2 id="how-do-you-interop"&gt;How do you interop?&lt;/h2&gt;
&lt;p&gt;It turns out that matplotlib has a headless mode where we can export the graphics and then display it using any method that we would normally use to display a .png file. In my case, I made a quick macro for it using the shell &lt;code&gt;open&lt;/code&gt;. I&amp;rsquo;m sure that someone out that could improve upon it, (and maybe even make it a cool utility lib), but it suits what I&amp;rsquo;m doing so far:&lt;/p&gt;</description></item></channel></rss>