0
import pandas as pd
import io
from google.colab import files
uploaded = files.upload()
df = pd.read_excel(io.BytesIO(uploaded['202009 - Shantanu.xlsm']),sheet_name='1 D',header=16,usecols=['Shift Details','Total Hours'])
df1 = pd.read_excel(io.BytesIO(uploaded['202009 - Shantanu.xlsm']),sheet_name='1 D',header=3)
df = df.rename({'Shift Details': 'Activity', 'Total Hours': 'Hours'}, axis=1)
df=df.assign(ContractNo='McKay2021')
df=df.assign(PlodDate='D5') #Instead of D5 I want date value
df=df.assign(PlodShift='D6') #Instead of D6 I want shift value

Code Attached in Google Colab

Excel File Attached

Problem: How to get the value of a particular cell of excel worksheet in python? Last two lines of the code.

enter image description here

1 Answer 1

1

you can use xlrd library for that, pip install xlrd would help. This link would help you in getting the exact cell value: https://www.geeksforgeeks.org/reading-excel-file-using-python/

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.