0

I have looked for a while on this one but can't seem to find out how to pick a specific cell value in an excel worksheet and assign it to variable in python. I get a Traceback Error with the code below.

I have a number of work rules I want to assign as variables in python that are stored in an cells within an excel workhseet.

(work rules[4][2] is how I am trying to make the cell value into a variable.

Code:

work_rules = pd.read_excel(
    'D:\\Personal Files\\Technical Development\\PycharmProjects\\Call Center Headcount Model\\Call Center Work Rules.xlsx',
    sheet_name='Inputs')

historical_start_date = work_rules[4][2]

print(historical_start_date)

1 Answer 1

1

Found it: Use the iloc method on the excel object: work_rules.iloc(4, 2)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.