Kyaw

On Jun 11, 2017 10:44 PM, [email protected] wrote:
[email protected]<https://groups.google.com/forum/?utm_source=digest&utm_medium=email#!forum/google-spreadsheets-api/topics>
     Google 
Groups<https://groups.google.com/forum/?utm_source=digest&utm_medium=email/#!overview>
   [http://www.google.com/images/icons/product/groups-32.png] 
<https://groups.google.com/forum/?utm_source=digest&utm_medium=email/#!overview>
Topic digest
View all 
topics<https://groups.google.com/forum/?utm_source=digest&utm_medium=email#!forum/google-spreadsheets-api/topics>

  *   Google Sheets API error with Python: DataFrame not callable - 1 Update
  *   Adding Calculations like Sum to Entire colum using sheets api php - 2 
Updates

Google Sheets API error with Python: DataFrame not callable 
<http://groups.google.com/group/google-spreadsheets-api/t/41ca6ff08ae1116c?utm_source=digest&utm_medium=email>
Frank Pinto <[email protected]>: Jun 11 09:14AM -0700

I'm designing a desktop app in Windows using Python that logs into a google
sheets to get some client information to do some tasks afterward.
Essentially it is a time dependent app that does a particular set of
actions while local time is less than 7:30 PM. Here's the layout of main
function 'full()':

def full():
inst = 1
while datetime.datetime.now().time() <= datetime.time(19, 30):
if inst == 1:
global customers
customers = customers()
else:
new_c = customers()
c = updat(customers, new_c)
customers = new_c[c]
time.sleep(10*60)
inst += 1

When it hits the second iteration of the process (inst = 2), the consolse
thows out the error of "'DataFrame' object is not callable". This is very
odd because the first time it rolls through it works fine.

The two functions 'customers()' and 'update()' are:

def customers():
scope = ['https://spreadsheets.google.com/feeds']
creds = ServiceAccountCredentials.from_json_keyfile_name('client_id.json', 
scope)
gs = gspread.authorize(creds)
sheet = gs.open('RC').sheet1
c_list = sheet.get_all_records()
return pd.DataFrame(c_list)
def updat(a, b):
c = []
for i in range(len(b)):
for j in range(len(a)):
if b.Nombre.iloc[i] == a.Nombre.iloc[j]:
c.append(False)
break # fix #1
else: # fix #2
c.append(True)

return c

It might be worth knowing that the layout of the function is design to read
the google sheets to check for client information, and after the first time
just read the newer entries (the olds will be ignored).

Thanks,

Back to top
Adding Calculations like Sum to Entire colum using sheets api php 
<http://groups.google.com/group/google-spreadsheets-api/t/364bf020579640e5?utm_source=digest&utm_medium=email>
ritesh khare <[email protected]>: Jun 11 03:39AM -0700

hey everyone ,

I am dynamically creating sheets using php api.

once the sheets are created - I am using Google_Service_Sheets batchupdate
method to update the rows.

Lets say i have a 2rows and 6 colums (1,2,hello , 4 , time , jojo)

The rows are dynamic as i am appending data in realtime.

I need what i can do to is keep the last row for calculation of Colums
like sum total etc.

Which class do i need to use to do that ?

Ritesh

ritesh khare <[email protected]>: Jun 11 03:51AM -0700

Hi Eric ,
In the response of batch update

Google_Service_Sheets_BatchUpdateSpreadsheetResponse::__set_state(array(
'collection_key' => 'replies',
'repliesType' => 'Google_Service_Sheets_Response',
'repliesDataType' => 'array',
'spreadsheetId' => 'id of my sheet',
'updatedSpreadsheetType' => 'Google_Service_Sheets_Spreadsheet',
'updatedSpreadsheetDataType' => '',
'internal_gapi_mappings' =>
array (
),
'modelData' =>
array (
'replies' =>
array (
0 =>
array (
),
),
),
'processed' =>
array (
),
))


After the update i need to get the dimensions of the current table rows -
there is a object class do i need to send it in a separate request or?


(2) Reason why i am asking about range is - lets say the rows will keep
getting added and the last rows i need to calculate sum or any other excel
custom forumla. after adding the row SUM (G2:G3) needs to be updated to
SUM (G2:G3) but instead what it does is creates a new row below

even if i manually place the sum() in the spreadsheet the data keeps
getting added after the sum row.which is quite confusing.


Can you point me in the right direction as i cant find any relevent example
for this.


Also - Spreadsheets.values it only works with spreadsheet id and is not for
internal sheets that has been added correct took me a while to figure that
out.

Hoping for a responce from your end.

Thanks
Ritesh

On Sunday, June 11, 2017 at 4:09:07 PM UTC+5:30, ritesh khare wrote:

Back to top
You received this digest because you're subscribed to updates for this group. 
You can change your settings on the group membership 
page<https://groups.google.com/forum/?utm_source=digest&utm_medium=email#!forum/google-spreadsheets-api/join>.
To unsubscribe from this group and stop receiving emails from it send an email 
to 
[email protected]<mailto:[email protected]>.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Spreadsheets API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to