1

Side note, I'm new to python3 and don't know the correct term for what something like df.Id would be called.

Here is what I have so far:

    import pandas as pd

df = pd.read_csv("desktop/python/test.csv")

column_name = input('column name ')
column_name1 = ("df." + column_name)
print(df.column_name)

My goal is to have the user input which column they want to see which will go into the df. function and print the column.

Red
  • 26,798
  • 7
  • 36
  • 58

1 Answers1

0

Like this:

import pandas as pd

df = pd.read_csv("desktop/python/test.csv")

column_name = input('column name ')

print(df[column_name])
Red
  • 26,798
  • 7
  • 36
  • 58