2 ms·
I don't know the name of this idiom, but the following is valid Python: import pandas as pd my_df = ( pd.Dataframe(<fetch_data>) .join(<...>) .
by pid-1 3y ago
I don't know the name of this idiom, but the following is valid Python:
import pandas as pd
my_df = (
pd.Dataframe(<fetch_data>)
.join(<...>)
.query(<...>)
.sort_values(<...>)
)
I also use plotly like so:
my_plot = (
px.line(<...>)
.update_xaxes(<...>)
.update_layout(<...)
)
Not exactly function chaining, but I guess it has a similar effect.
I'm happy with Python's syntax nowadays and much prefer seeing improvements on library / environment related things.
- rowanG077 3y agoIt's called a fluent interface.