File tree Expand file tree Collapse file tree
src/components/SidePlanes Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import React from 'react'
2+ import { DataFrame } from 'danfojs/src/core/frame'
3+ export default function Describe ( { dataComp, setDataComp} ) {
4+
5+ const describe = ( ) => {
6+
7+ const df = dataComp . df . describe ( )
8+ let column = df . columns . slice ( )
9+ column . splice ( 0 , 0 , "index" )
10+ const values = df . values
11+ const indexes = df . index
12+
13+ const new_values = values . map ( ( val , index ) => {
14+ let new_val = val . slice ( )
15+ new_val . splice ( 0 , 0 , indexes [ index ] )
16+ return new_val
17+ } )
18+
19+ setDataComp ( prev => {
20+ let new_data = prev . slice ( )
21+ let dict = {
22+ columns : column ,
23+ values : new_values ,
24+ df : df
25+ }
26+ new_data . push ( dict )
27+ return new_data
28+ } )
29+ }
30+ return (
31+ < div >
32+ < button onClick = { ( ) => describe ( ) } className = "bg-blue-700 text-white rounded-sm p-2" > Describe</ button >
33+ </ div >
34+ )
35+ }
You can’t perform that action at this time.
0 commit comments