background preloader

GitHubExplorer

Facebook Twitter

Data Visualization with Javascript. In chapter 1 we saw how to create a wide variety of simple, static charts. In many cases such charts are the ideal visualization; however, they don’t take advantage of an important characteristic of the web—it’s interactivity. Sometimes you want to do more than just present data to your users; you want to give them a chance to explore the data, to focus on those elements they find particularly interesting, or to consider alternative scenarios. In those cases we can really take advantage of the web as a medium by adding interactivity to our visualizations. Because they’re designed for the web, virtually all of the libraries and toolkits we examine in this book include support for interactivity.

That’s certainly true of the flotr2 library that chapter 1 covers. But since we have a new chapter, we can take the opportunity to explore alternatives. For this chapter, we’re also going to stick with a single data source: the Gross Domestic Product (GDP) for countries worldwide. And that’s it. Examples — Requests-OAuthlib 0.4.0 documentation. Json – JavaScript Object Notation Serializer.

The json module provides an API similar to pickle for converting in-memory Python objects to a serialized representation known as JavaScript Object Notation (JSON). Unlike pickle, JSON has the benefit of having implementations in many languages (especially JavaScript), making it suitable for inter-application communication. JSON is probably most widely used for communicating between the web server and client in an AJAX application, but is not limited to that problem domain.

Encoding and Decoding Simple Data Types The encoder understands Python’s native types by default (string, unicode, int, float, list, tuple, dict). Values are encoded in a manner very similar to Python’s repr() output. Encoding, then re-decoding may not give exactly the same type of object. In particular, strings are converted to unicode and tuples become lists. Human-consumable vs. Another benefit of JSON over pickle is that the results are human-readable. Encoding Dictionaries Working with Your Own Types Mixed Data Streams. Python and AJAX tutorial for beginners with web.py and jQuery | Kooneiform. Note: I’m always surprised to see this at the top of a Google search for ‘ajax python’. It has been three and a half years after all (though I guess that’s how these things work sometimes). I haven’t been following the state of Python web development at all, so this code may be badly out-of-date, simply not work, etcetera. If you’re just starting out on your Pythonic path, I feel like my best recommendation is to Google on, my friend, Google on… – George 14 September, 2013 As a result of following along with the NYU class Reading and Writing Electronic Text I started to get into using Python for web apps — this, along with learning JavaScript, is something I’d been wanting to do for a while.

I’ll try to summarize what I’ve learned over the last week or so. Python already was the choice for the server-side script. I decided to keep it simple (though I still want to learn frameworks like Django, TurboGears, etcetera at some point in the future). Finally we define the tutorial class. Flot: Attractive JavaScript plotting for jQuery. Bootstrap.

10 Minutes to Pandas — pandas 0.12.0 documentation. This is a short introduction to pandas, geared mainly for new users. You can see more complex recipes in the Cookbook Customarily, we import as follows: In [1]: import pandas as pd In [2]: import numpy as np In [3]: import matplotlib.pyplot as plt Object Creation See the Data Structure Intro section Creating a Series by passing a list of values, letting pandas create a default integer index: In [4]: s = pd.Series([1,3,5,np.nan,6,8]) In [5]: sOut[5]: 0 1.01 3.02 5.03 NaN4 6.05 8.0dtype: float64 Creating a DataFrame by passing a numpy array, with a datetime index and labeled columns: Creating a DataFrame by passing a dict of objects that can be converted to series-like. Having specific dtypes In [12]: df2.dtypesOut[12]: A float64B datetime64[ns]C float32D int32E categoryF objectdtype: object If you’re using IPython, tab completion for column names (as well as public attributes) is automatically enabled.

In [13]: df2. As you can see, the columns A, B, C, and D are automatically tab completed. Note. The Most Advanced Responsive Front-end Framework from ZURB. Arbor.js. Fdion / pyptug / source / webpy / API v3. JqPlot Charts and Graphs for jQuery.