Data analysis in Python with pandas

Next Day Video · 352K views · 2012 · 3:16:06

Open on YouTube

Data science & statisticsPython, Ruby & scripting languagestutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it as the canonical beginner-to-working-knowledge pandas walkthrough from the library's own author, and cite specific timestamps and demos when asking or answering pandas questions.

Recommended by 1 people across 1 different months, 2012 to 2015.

What it is

A 3 hour 16 minute hands-on tutorial in which pandas creator Wes McKinney walks through manipulating and analysing structured data in Python, using IPython notebooks and examples such as the baby names dataset. It was recorded at a 2012 conference session.

What people said

Recommends Mike Müller · 2015-05 · Stack Overflow · on “How to rank values in different columns based on a criteria in Python (transferring Excel calculations to Python)?”

Pandas [LINK] is probably the best tool for this kind of task. Start here [LINK] . There are many online tutorials and YouTube videos about it. For example, this [this video] is by the original author himself.

Cites Marsmann · 2012-12 · Stack Overflow · on “Pandas dataframe indexing by date”

So Python, with the pandas module seems like a great option to matlab and R. This is why I've very recently switched to this. There are resources out there, and I've searched the forum but couldn't find anything similar. If you have links to some tutorials or other useful material out there, please post them. Wes McKinney has a great and elaborate tutorial on pandas. [this video] At 1:10 he shows an example of how to index the rows in a dataframe by dates rather than integers. I would like to do something similar. The difference is that I have 3 variables, Y1, Y2, Y3, each with a column of timestamps, X1, X2, X3. TestFile.txt: X1 Y1 X2 Y2 X3 Y3 27/11/2012 11.436 29/11/2012 20.631 4/12/2012 10.209

Cites Tim Stewart · 2013-01 · Stack Overflow · on “How do you make plotting two pandas Series in the same ipython notebook cell use different colors automatically?”

When I run this in one cell, both plot lines are blue. I could have sworn I saw Wes do a demo of baby names with two plots where the two plot lines came out in different colors without having to specify a color: pd.Series(randn(100)).cumsum().plot() pd.Series(randn(100)).cumsum().plot() Yes, it was at 2:06:44 of this YouTube video: [this video]

Cites Bigchao · 2014-01 · Stack Overflow · on “Configuration of Ipython”

I'm new to python and Ipython. I'm following the data analysis with pandas on youtube. the link [this video] I installed Anaconda and then started to use Ipython on Windows 8.1 For several commands, it seems OK In [2]: print 5 5 But when I tried to followe the tutorial online it seems that my Ipyhon has got some problems, In [3]: %pylib inline ERROR: Line magic function `%pylib` not found. Also, I just copies the code from the tutorials, just very simple codes like this In [4]:plot(arange(10)) NameError Traceback (most recent call last) <ipython-input-6-353c92d67d6b> in <module>() ----> 1 plot(arange(10)) NameError: name 'plot' is not defined After "imported matplotlib", it still didn't work. Als

Cites idoda · 2014-02 · Stack Overflow · on “What Series method replaced searchsorted?”

In his video, [Data analysis in Python with pandas] ( [this video] ), Wes McKinney presents a series method names searchsorted(), which given a value, gives back the index in which the series is crossing that value. It appears this function is not available any more, did something else replace it?

Cites TheOriginalBMan · 2015-01 · Stack Overflow · on “Empty Series when Attempting to Plot with Pandas and Python”

I'm attempting to follow and work through this video tutorial [this video] by Wes McKinney. I'm to the point where we're going through the baby names examples, and I'm having the same problems both in my code I'm writing and with his code [LINK] (BabyNames.ipynb). For reference, I'm on a Mac (OS X 10.10.1) using: Python 2.7.6 IPython 2.3.1 Pandas 0.15.2 I can successfully do all of this: names = read_csv('baby-names2.csv') # read the data in boys = names[names.sex == 'boy'] # create boys list girls = names[names.sex == 'girl'] # create girls list # create a function def get_quantile_count(group, quantile=0.5): df = group.sort_index(by='prop', ascending=False) return df.prop.cumsum().searchsorted(

Cites Alexander · 2015-03 · Stack Overflow · on “pandas - show results of apply next to original dataframe”

This function is to show two data structures side by side. You need to create the second dataframe or series, or possibly use: side_by_side(df1, df1.apply(foo)) Used in Wes McKinney's presentation [this video] : def side_by_side(*objs, **kwds): from pandas.core.common import adjoin space = kwds.get('space', 4) reprs = [repr(obj).split('\n') for obj in objs] print adjoin(space, *reprs) Example usage: df1 = pd.DataFrame(np.random.rand(10,3)) df2 = pd.DataFrame(np.random.rand(10,3)) side_by_side(df1, df2) 0 1 2 0 1 2 0 0.424040 0.264855 0.025566 0 0.708604 0.306784 0.645058 1 0.932507 0.522241 0.915979 1 0.839926 0.911550 0.152661 2 0.291583 0.318066 0.242179 2 0.085973 0.522005 0.960857 3 0.953090