Methods in Python where the array type does not exist in the scientific notation file

Source: Internet
Author: User

Directly on the code:

From numpy Import *
Import NumPy as NP
Drug_array = Zeros ((708,708), dtype = int)
f = open (' D:\mat_drug_drug.txt ')
lines = F.readlines ()
Drug_row = 0
For line in lines:
List = Line.strip (' \ n '). Split (')
Drug_array[drug_row:] = list[:]
Drug_row + = 1
Print (Shape (drug_array))
Np.savetxt (' d:\ start, juvenile \ Extract \ Final extract \drug_drug.txt ', drug_array,fmt = ['%s ']*drug_array.shape[1],newline = ' \ n ')

Direct Deposit TXT is always scientific notation, it is not very convenient to see the number directly, with FMT can be achieved without scientific counting method storage.
FMT detailed content:https://docs.scipy.org/doc/numpy/reference/generated/numpy.savetxt.html

Methods in Python where the array type does not exist in the scientific notation file

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.