-1

i'm pretty sure there is a way to do this in Python, but i couldn't find a way. Thanks for the help.

  • Customer.Name (Variable.Property)

Want to use the property's name directly in code, rather than hard-coded it.

colName = Customer.Name.*toString()*  
dataframe.drop(colName, 1)
Xenova
  • 1
  • Relevant resource: https://stackoverflow.com/questions/18425225/getting-the-name-of-a-variable-as-a-string – Xenova Sep 07 '17 at 02:20

2 Answers2

0

It's pretty simple how to do this. just use the str() function. For example:

vbl = True
print(str(bvl))
True
Box Fan
  • 43
  • 7
  • Thanks for the reply. Wondering how do i achieve the following: `vbl = True` `print(str(vbl))` `vbl` Which means instead of printing the content of a variable, can i just print the name of the variable (which is 'vbl' in this case). – Xenova Sep 07 '17 at 02:16
0
Customer.Name(str(Variable.Property))