python - Numpy.savetxt() function -


मेरे पास कई कॉलम वाला एक टेबल है और इसे

  numpy.savetxt 'Test.txt', test, fmt = '% f')   

मैं केवल अंतिम कॉलम को फ्लोट प्रारूप में सहेजना चाहता हूं, अन्य सभी कॉलम पूर्णांक होना चाहिए ... उदाहरण के लिए

  1 1 1 0.5 1 2 2 0.3 । । ।   

मैं अपने savetxt फ़ंक्शन को कैसे बड़ा कर सकता हूँ या कुछ विकल्प का उपयोग कर सकता हूँ? अग्रिम में आपका धन्यवाद!

एफएमटी इस तरह एक सरणी हो सकती है:

 < कोड> numpy.savetxt ('test.txt', test, fmt = ['% d', '% d', '% d', '% f'])    

Comments

Popular posts from this blog

c# - The item with identity 'Id' already exists in the metadata collection. Parameter name: item -

jquery - How to make a wrapper function in javascript? -

sql - PostgreSQL automatically update row at specific date -