GithubHelp home page GithubHelp logo

unable to get header row about corefxlab HOT 5 CLOSED

liugaocn avatar liugaocn commented on July 24, 2024
unable to get header row

from corefxlab.

Comments (5)

liugaocn avatar liugaocn commented on July 24, 2024 1

Thank you for replying. I don't use Jupyter, I use Visual Studio and Rider.
I will be very happy to contribute when I get a better understanding.

from corefxlab.

liugaocn avatar liugaocn commented on July 24, 2024

since nobody answers.

from corefxlab.

pgovind avatar pgovind commented on July 24, 2024

Sorry! I must've missed this issue. Can you elaborate a little bit more on what you want? Do you just want to see the column names? If you are using Jupyter, you can just execute dataframe_variable_name in a cell and (if you also have the formatter set up) you should see the column names in the output. If you are not in a notebook, dataframe_variable_name.Columns (DataFrameColumnCollection.cs)stores the column names inside it internally. They are just not exposed publicly at the moment. If you put up a PR to create a public property that exposes the column names, we'd be happy to review it!

from corefxlab.

liugaocn avatar liugaocn commented on July 24, 2024

@pgovind Maybe this would work.

public List<string> GetColumnNames()
{
    // df is a dataframe.
    DataFrameColumnCollection dataFrameColumnCollection = df.Columns;
    List<string> columnNames = new List<string>(); // A list of all columnNames
    foreach (var column in dataFrameColumnCollection)
    {
        columnNames.Add(column.Name);
    }

    return columnNames;
}``

from corefxlab.

pgovind avatar pgovind commented on July 24, 2024
  1. I would call the API ColumnNames" and make it a property instead of a method. I would also define this method in DataFrame.cs`
  2. I would change the return type to IReadOnlyList<string> so that the returned list is immutable
  3. In the implementation, I think you can just do return Columns._columnNames;

from corefxlab.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.