I have a data file with thousands of bills. When I try to extract a single cell value I notice the type is <class 'numpy.ndarray'>
. Is there a way to extract an element as a primitive value like float
or int
directly from the dataframe or series?
import pandasql as ps
import pandas as pd
df = pd.read_csv(strFPath, sep='|', encoding='windows-1252')
strQry = "SELECT SUM(BILLHOURS) AS 'BILLHOURS' FROM df"
dfQry = ps.sqldf(strQry, globals())
intHoursAll = float(dfQry.values[0].round(2))