Marc Garcia - Towards Pandas 1.0

PyData · 11K views · 2018 · 34:24

Open on YouTube

Python, Ruby & scripting languagesData science & statisticstalkdated

Why Stack Overflow recommends it

Stack Overflow users link it when discussing pandas method chaining and DataFrame.assign, citing the talk's guidance on idiomatic pandas style and future direction.

Recommended by 1 people across 1 different months, 2018 to 2022.

What it is

A PyData London Meetup talk by pandas core developer Marc Garcia, given ten years after pandas development began. It covers the project's motivation, history, current development and latest features, and what to expect on the road to pandas 1.0.

What people said

Recommends ndclt · 2019-08 · Stack Overflow · on “Pandas: Should I use Apply Lambda for simple functions?”

You can use assign which is the method recommended by Marc Garcia in his talk toward pandas 1.0 [this video] because you can chain operations on the same dataframe see example between 6:17 and 7:30: DF = DF.assign(PRINCIPAL=lambda x: x['PRINCIPAL'].str.split("@", expand=True)[0])

Cites Jarno · 2018-11 · Stack Overflow · on “Assign to a subset of a column using method chaining in Pandas”

> You should view "method chaining" as a means to an end rather than a requirement or objective in its own right. Fair enough. Just judging from this talk [this video] I got the impression that Pandas is promoting method chaining as new default way to do most things. Also be aware that inplace might be deprecated in the future.

Cites simcheuk · 2022-04 · Stack Overflow · on “Apart from 'assign', is there any other pandas method we can use for creating/changing columns?”

I am a pandas user and I am used to method chaining with pandas functions because I think the readability is better. Among the functions pandas provided, assign [LINK] takes an important role when I am creating or changing columns of a dataframe. Recently, I would like to know the performance of the assign function comparing with normal assignment method. For example, normal assignment method: a = pd.DataFrame({'col0': [1, 2, 3], 'col1': ['i', 'j', 'k']}) a['col2'] = [7, 8, 9] assign function: b = pd.DataFrame({'col0': [1, 2, 3], 'col1': ['i', 'j', 'k']}) b = b.assign(col2 = [7, 8, 9]) The 2 ways give the same output. However, when I look at their identity with id() , it suggests that the as