Improving DataFrame views. DataFrame needs to be added in the dependencies.

This commit is contained in:
Offray Vladimir Luna Cárdenas 2024-03-28 22:19:06 -05:00
parent 536d2a9326
commit 428936c1a7
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,19 @@
Extension { #name : #DataFrame }
{ #category : #'*MiniDocs' }
DataFrame >> viewDataFor: aView [
<gtView>
| columnedList |
self numberOfRows >= 1 ifFalse: [ ^ aView empty ].
columnedList := aView columnedList
title: 'Data';
items: [ self transposed columns ];
priority: 40.
self columnNames
withIndexDo: [:aName :anIndex |
columnedList
column: aName
text: [:anItem | anItem at: anIndex ]
].
^ columnedList
]

View File

@ -20,6 +20,17 @@ String >> asDashedLowercase [
^ '-' join: (self substrings collect: [:each | each asLowercase ]) ^ '-' join: (self substrings collect: [:each | each asLowercase ])
] ]
{ #category : #'*MiniDocs' }
String >> asInteger [
"Return the integer present in the receiver, or nil. In case of float, returns the integer part."
"'1' asInteger >>> 1"
"'-1' asInteger >>> -1"
"'10' asInteger >>> 10"
"'a' asInteger >>> nil"
"'1.234' asInteger >>> 1"
^ (self copyWithoutAll: '_') asSignedInteger
]
{ #category : #'*MiniDocs' } { #category : #'*MiniDocs' }
String >> contentsWithoutYAMLMetadata [ String >> contentsWithoutYAMLMetadata [
| newContents | | newContents |