Loading data Numpy

    0

    0

    The code arr = np.loadtxt("sample_data.csv", delimiter=",", dtype=str) creates an array of objects which have the following attributes:

    • name: array containing the column names in the file sample_data.
    import numpy as np
    
    # using loadtxt()
    arr = np.loadtxt("sample_data.csv",
      delimiter=",", dtype=str)
    display(arr)
    
    
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.