How to read excel file in python I already used some program but not work.

I want to create folder folder of separate sets 

I hope, it helps you in understanding how to read excel file, try to correctly specify your file path. In my case ./ means current file where my python file exist. Move your excel file where your python file exist
Install:
pip install pandas openpyxl
Solution 1
import pandas as pd
df = pd.read_excel('./TfidfVectorizer_sklearn.xlsx')
df
Solution 2
import openpyxl
book = openpyxl.load_workbook('./TfidfVectorizer_sklearn.xlsx')
sheet = book.active
cells = sheet['A1': 'D5']
for c1, c2, c3, c4 in cells:
print(f"{c1.value} {c2.value} {c3.value} {c4.value}")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With