pycodestyle
pycodestyle copied to clipboard
E127: method chaining
I use method chaining in pandas very often, for example
import pandas as pd
df = (pd.read_csv('very/long/path/to/file/abcdefghijklmnopqrstuvwxyz.csv',
index_col='bar', encoding='utf-8')
.drop(labels='baz', axis=1))
in which I indent the lines according to the first dot . after pd.
Now sometimes, this works:

but also sometimes it doesn't, for example when the first part exceeds into a new line:

Any idea what's going wrong here?
I am using Spyder 4.0.0 | Python 3.7.3 64-bit | Windows 10