MCPcopy
hub / github.com/pandas-dev/pandas / func

Function func

pandas/core/col.py:415–427  ·  view source on GitHub ↗
(df: DataFrame)

Source from the content-addressed store, hash-verified

413 raise TypeError(msg)
414
415 def func(df: DataFrame) -> Series:
416 if col_name not in df.columns:
417 columns_str = str(df.columns.tolist())
418 max_len = 90
419 if len(columns_str) > max_len:
420 columns_str = columns_str[:max_len] + "...]"
421
422 msg = (
423 f"Column '{col_name}' not found in given DataFrame.\n\n"
424 f"Hint: did you mean one of {columns_str} instead?"
425 )
426 raise ValueError(msg)
427 return df[col_name]
428
429 return Expression(func, f"col({col_name!r})")
430

Callers 15

combineMethod · 0.70
_binopMethod · 0.70
nargminmaxFunction · 0.70
_nanargminmaxFunction · 0.70
preprocess_weightsFunction · 0.70
wrapperMethod · 0.70
aggMethod · 0.70
apply_standardMethod · 0.70
curriedMethod · 0.70
reconstruct_funcFunction · 0.70
pipeFunction · 0.70

Calls 1

tolistMethod · 0.45

Tested by

no test coverage detected