I've looked through StackOverflow and found a related question about a script that reads an excel file, read the row from excel, then write the row to Smartsheet.
I am getting an error where the 'pd' is not defined when I run the script to read an Excel file.
Does anyone know where the 'pd' id defined? I couldn't find it. Is there another way to do this?
RUN
pi@cenicapi:~/Documents/tscripts $ ./sample.s
Traceback (most recent call last):
File "./sample.s", line 16, in
data = pd.read_csv(r'Sample.xlsx')
NameError: name 'pd' is not defined
pi@cenicapi:~/Documents/tscripts $
SCRIPT CODE:
#!/usr/bin/python3.7
import logging
import csv
import os
# Log all calls
logging.basicConfig(filename='rwsheet.log', level=logging.INFO)
from simple_smartsheet import Smartsheet
from simple_smartsheet.models import Sheet, Column, Row, Cell, ColumnType
data = **pd**.read_csv(r'Sample.xlsx')
df = **pd**.DataFrame(data, columns=[ 'ccc_key_id', 'MyDate', 'CCD', 'Max In Only', 'Max Out Only', 'avg_bits_out_min'])
example = df.values.tolist()
print(example)
Appreciate any help