Skip to content

Commit

Permalink
ColumnName indexer on DataFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
Prashanth Govindarajan committed Aug 28, 2020
1 parent 496dece commit 5a7364d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Microsoft.Data.Analysis/DataFrame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,18 @@ public DataFrame(params DataFrameColumn[] columns)
}
}

/// <summary>
/// An indexer based on <see cref="DataFrameColumn.Name"/>
/// </summary>
/// <param name="columnName">The name of a <see cref="DataFrameColumn"/></param>
/// <returns>A <see cref="DataFrameColumn"/> if it exists.</returns>
/// <exception cref="ArgumentException">Throws if <paramref name="columnName"/> is not present in this <see cref="DataFrame"/></exception>
public DataFrameColumn this[string columnName]
{
get => Columns[columnName];
set => Columns[columnName] = value;
}

/// <summary>
/// Returns the first <paramref name="numberOfRows"/> rows
/// </summary>
Expand Down

0 comments on commit 5a7364d

Please sign in to comment.