Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6563831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:53:41+00:00 2026-05-25T13:53:41+00:00

I cant get the insert to work in this code. I have other numpy

  • 0

I cant get the insert to work in this code.
I have other numpy to mysql that work fine. But there are no errors in running code. Mysql gives no errors. Using python 2.7 and pyodbc on winx64.

p = np.arange(1, 33, 3)
print p

def prow (f1,series):
    rowp=[]
    series = series.tolist()
    ss = series[8:]
    rowp.append(1)       
    rowp.extend(ss)         

    print len (rowp)
    print rowp
    print type(rowp)  

    InSQL  = 'INSERT INTO test._t VALUES (1, 25, 28, 31)' 
    print InSQL
    # csr.executemany(InSQL,rowp)
    csr.execute(InSQL)
    print 1234   
    cxn.commit

prow('foo', p)

MySql is below:

CREATE TABLE `_t` (
  `Id` int(11) DEFAULT NULL,
  `T1` float(12,4) DEFAULT NULL,
  `T2` decimal(12,4) DEFAULT NULL,
  `T7` float(12,4) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1

This print statements give;

[ 1  4  7 10 13 16 19 22 25 28 31]
4
[1, 25, 28, 31]
<type 'list'>
INSERT INTO test._t VALUES (1, 25, 28, 31)
1234

Using the “INSERT INTO test._t VALUES (1, 25, 28, 31)” in mysql shell works just fine. there is alot of redundant code, right now. The idea is to use executemany, but I cant the
the simple code to work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T13:53:41+00:00Added an answer on May 25, 2026 at 1:53 pm

    Your commit is missing parens:

    cxn.commit
    
    # Should be:
    cxn.commit()
    

    Run from the interpreter, cxn.commit without parens simply returns a reference to the commit() method:

    # Something like
    >>> conn.commit
    <built-in method commit of Connection object at 0x9cfe13c>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm probably doing something realy stupid but I cant get this to work: var
I have read other related question but i cant really get them to relate
I have looked all over the place but I cant seem to get this
This might be something silly really, but I can't get it to work at
with $element->children() i cant get all the child elements of current element. but how
I am generating assembly on runtime . Problem is that i cant get rid-of
Revising for php and cant seem to get this to print the values out
When I paste this code into a REPL, it works fine: (use 'clojure.contrib.seq-utils) (defn-
I have a C# app I'm working on that loads it's code remotely, and
I have a contact form on site which used to work, but since last

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.