Skip to content

Commit 237cf56

Browse files
risenWgitbook-bot
authored andcommitted
GitBook: [master] 3 pages modified
1 parent 59402dd commit 237cf56

File tree

3 files changed

+53
-1
lines changed

3 files changed

+53
-1
lines changed

api-reference/series/danfo.series.describe.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Generate descriptive statistics. Descriptive statistics include those that summa
88

99
**parameter:**
1010

11-
**return:** {Series}
11+
**return:** {frame}
1212

1313
**Example**
1414

Original file line numberDiff line numberDiff line change
@@ -1,2 +1,29 @@
11
# danfo.Series.reset\_index
22

3+
4+
5+
Generate a new Series with the index reset. This is useful when the index needs to be treated as a column, or when the index is meaningless and needs to be reset to the default before another operation.
6+
7+
8+
9+
**parameter:** {kwargs} {inplace: Modify the Series in place \(do not create a new object, drop: Just reset the index, without inserting it as a column in the new DataFrame.}
10+
11+
**return:** {Series}
12+
13+
**Example**
14+
15+
```javascript
16+
let data = [{ alpha: "A", count: 1 }, { alpha: "B", count: 2 }, { alpha: "C", count: 3 }]
17+
let df = new Series(data)
18+
let df_new = df.set_index({ "index": ["one", "two", "three"] })
19+
let df_reset = df_new.reset_index()
20+
df_reset
21+
22+
23+
let data = [1,2,3,4,5,6]
24+
let df = new Series(data)
25+
df.set_index({ "index": ["one", "two", "three", "four", "five", "six"], "inplace": true })
26+
let df_new = df.reset_index()
27+
df_new
28+
```
29+
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,27 @@
11
# danfo.Series.set\_index
22

3+
4+
5+
Generate a new Series with the specified index. Set the Series index \(row labels\) using an array of the same length.
6+
7+
8+
9+
**parameter:** {kwargs} {index: Array of new index values}
10+
11+
**return:** {Series}
12+
13+
**Example**
14+
15+
```javascript
16+
let data = [{ alpha: "A", count: 1 }, { alpha: "B", count: 2 }, { alpha: "C", count: 3 }]
17+
let df = new Series(data)
18+
let df_new = df.set_index({ "index": ["one", "two", "three"] })
19+
df_new
20+
21+
22+
let data = [{ alpha: "A", count: 1 }, { alpha: "B", count: 2 }, { alpha: "C", count: 3 }]
23+
let df = new Series(data)
24+
let df_new = df.set_index({ "index": ["one", "two", "three"] })
25+
df_new
26+
```
27+

0 commit comments

Comments
 (0)