background preloader

Thinkpython.pdf (application/pdf-objekt)

Thinkpython.pdf (application/pdf-objekt)

Dive Into Python Python Course: Tutorial, Reference and Advanced Topics Learn Python - Free Interactive Python Tutorial Online Python Tutor - Learn programming by visualizing code execution VPython Python Resources | edX Wiki Skip to this view's content Please enter your e-mail address below, and we will e-mail instructions for setting a new password. Help Have general questions about edX? You can find lots of helpful information in the edX FAQ. Have a question about something specific? Report a problem Make a suggestion Ask a question Please note: The edX support team is English speaking. Thank you for your inquiry or feedback. We're Sorry, edX accounts are unavailable currently The following errors occurred while logging you in: Your email or password is incorrect Please provide the following information to log into your edX account. Required Information Account Preferences

coding style - What is a clean, pythonic way to have multiple constructors in Python Second Try: Sentiment Analysis in Python : Andy Bromberg Introduction After my first experiments with using R for sentiment analysis, I started talking with a friend here at school about my work. Jackson and I decided that we’d like to give it a better shot and really try to get some meaningful results. We also met with Christopher Potts, a professor of linguistics here at Stanford. If you’d like to jump straight to seeing the full code, you can head over to the GitHub repository. The Setup One of the resources we got a lot of mileage out of was StreamHacker, especially the articles on basic techniques, precision and recall. and eliminating features. Another great discovery was the Natural Language ToolKit (NLTK). During our first attempt, we basically just tried to convert my program in R into Python. An important piece of sentiment analysis terminology: “features” are whatever you’re analyzing in an attempt to correlate to the labels. As an aside, here are the imports we used for the project, so I won’t have to reference them again: Addendum

Graphics with Matplotlib Matplotlib is a large and sophisticated graphics package for Python written in object oriented style. However, a layer built on top of this basic structure called pyplot accesses the underlying package using function calls. We describe a simple but useful subset of pyplot here. 4.1 Line plots 4.1.1 Simple plots Let’s type the following into Python: >>> from numpy import * >>> import matplotlib.pyplot as plt >>> x = arange(0.,10.,0.1) >>> y = sin(x) >>> ll = plt.plot(x,y) >>> plt.show() >>> The first two lines import respectively the numpy and matplotlib pyplot modules. Calls to most pyplot functions return stuff that can sometimes be used in subsequent functions. Text such as a title, labels, and annotations can be added to the plot between the plt.plot and the plt.show commands. The resulting plot is shown in figure 4.2. 4.1.2 Multiple lines and points More complicated plots with multiple lines and line types can be made: The resulting plot is shown in figure 4.3. 4.2 Log plots and histograms

CPython Compilers

Related: