These are chat archives for evhub/coconut

18th
Jul 2017
Evan Hubinger
@evhub
Jul 18 2017 07:23
@rts-2 (Also, for reference, "in-place" operators are those like += and -= that perform the operation on the object currently assigned to the variable and then reassign the new value to that variable.)
Jason O.
@puruzio
Jul 18 2017 17:54
Hi, how can I get something like this to work using partial application and pipeline? Thanks.
import pandas as pd
from pandas import DataFrame
df = pd.read_csv(filename)

(df[‘Batch Date’]
|> pd.to_datetime$(?).min() <<<<<<<< This currently complains “a non-? partial application argument is required"
|> print
)
Evan Hubinger
@evhub
Jul 18 2017 23:27

@puruzio I think you want

import pandas as pd
df = pd.read_csv(filename)

(df['Batch Date']
    |> pd.to_datetime
    |> .min()
    |> print
)

The issue with func$(?) or func$() is that they are always no-ops, since they don't actually partially apply any additional arguments to the function, so Coconut disallows them.

Jason O.
@puruzio
Jul 18 2017 23:31
It works! Thank you.