Skip to content

how to read .csv file with Numsharp? #386

Description

@guang7400613

how to read .csv file or .txt file wiht Numsharp(np) in C#?
is it np.load(string filename)?

Activity

  1. Oceania2018 commented on Jan 15, 2020

    @Oceania2018
    Member

    Should use Pandas.NET

  2. self-assigned this
    on Jul 18, 2026
  3. Nucs commented on Sep 7, 2026

    @Nucs
    Member

    Shipped in 0.70.0 (#628, via #616/#617). np.loadtxt reads CSV/TSV with the usual NumPy options (delimiter, skiprows, usecols, unpack, dtype):

    // data.csv:
    // 1,2,3
    // 4,5,6
    var a = np.loadtxt("data.csv", delimiter: ",");
    Console.WriteLine(a);
    // [[1. 2. 3.]
    //  [4. 5. 6.]]

    np.savetxt writes the round-trip, and np.genfromtxt is not ported (it needs structured/masked dtypes NumSharp doesn't have). Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions