What is Python's equivalent of deparse(substitute(INPUT))?

Given df is some dataframe

name_of_input = function(input) {
  # Report back the name of input
  cat(paste0(
    deparse(substitute(input))
  ))

name_of_input(df)

This would return 'df' as a string. I can do this in R, but is it possible to do this with Python dataframes? I couldn't really find the right solution between unevaluated expressions and lambda functions. And it's not for global objects.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.