-
Notifications
You must be signed in to change notification settings - Fork 73
count and countDistinct kdocs #1301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
||
import org.jetbrains.kotlinx.dataframe.DataFrame | ||
|
||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is duplicating [AccessApi.ExtensionPropertiesApi]. Could be fine if this adds more information, but then probably call this "ExtensionPropertiesInformation" or something and link from the other one to here.
* | ||
* For more information, see: {@include [DocumentationUrls.ExtensionPropertiesApi]} | ||
*/ | ||
internal interface ExtensionPropertiesAPIDocs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
camel casing
* allowing you to define a [Boolean] condition using the row's values, | ||
* including through [extension properties][ExtensionPropertiesAPIDocs] for convenient access. | ||
*/ | ||
internal interface RowFilterDescription |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*RowFilterDocs following our convention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file can be @file:ExcludeFromSources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somewhat duplicating the description at aliases.kt, but I think it's different enough
* | ||
* For more information: {@include [DocumentationUrls.Count]} | ||
* | ||
* @return the number of columns in this row. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@see columnCount maybe? since this is just an alias for that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, it doesn't make sense to link to the documentation website, as that's only for counting rows.
I'd probably even just write this piece of KDoc on columnsCount and @include it here
/** | ||
* Counts the number of elements in the current row that satisfy the given [predicate]. | ||
* | ||
* For more information: {@include [DocumentationUrls.Count]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
* | ||
* See also common [aggregate][Grouped.aggregate]. | ||
* | ||
* For more information: {@include [DocumentationUrls.Count]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from here, there might also be more helpful information here https://kotlin.github.io/dataframe/groupby.html
* - common [aggregate][Pivot.aggregate]. | ||
* - [pivotCounts][DataFrame.pivotCounts] shortcut. | ||
* | ||
* For more information: {@include [DocumentationUrls.Count]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here, maybe also link to the pivot docs
* ``` | ||
* | ||
* @return A [DataFrame] with [groupBy] rows and pivoted counts as columns matching the [predicate].. | ||
*/ | ||
public inline fun <T> PivotGroupBy<T>.count(crossinline predicate: RowFilter<T>): DataFrame<T> = | ||
aggregate { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you fix this strangely linted function? :) not sure what the 0 is doing down there
* | ||
* ### This [countDistinct] overload | ||
*/ | ||
internal interface CountDistinctDocs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ExcludeFromSources
public fun AnyFrame.countDistinct(): Int = countDistinct { all() } | ||
|
||
/** | ||
* Returns number of distinct combinations of values in selected [columns] in this [DataFrame]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*[columns\] it links up incorrectly to a package and KoDEx replaces it with a fq name
Closes #1276