Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit94755c4

Browse files
minjk-blgitbook-bot
authored andcommitted
GITBOOK-49: Reshape
1 parentc1e1926 commit94755c4

File tree

5 files changed

+31
-41
lines changed

5 files changed

+31
-41
lines changed
77.2 KB
Loading
50.4 KB
Loading
36.2 KB
Loading
38.6 KB
Loading

‎docs/data-analysis/8.-reshape.md‎

Lines changed: 31 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,63 +4,53 @@ description: Reshape the Data into Long or Wide Format
44

55
#8. Reshape
66

7+
<figure><imgsrc="../.gitbook/assets/image (225).png"alt=""width="290"><figcaption></figcaption></figure>
78

9+
1. Click the_**Reshape**_ under the_**Data Analysis**_ category.
810

9-
<figure><imgsrc="../.gitbook/assets/image (55).png"alt=""width="278"><figcaption></figcaption></figure>
11+
<figure><imgsrc="../.gitbook/assets/image (226).png"alt=""width="406"><figcaption></figcaption></figure>
1012

11-
1. Choose the_**Reshape**_ under the Data Analysis category.
12-
13-
14-
15-
<figure><imgsrc="../.gitbook/assets/image (56).png"alt=""width="563"><figcaption></figcaption></figure>
16-
17-
2. Select the Reshape type.
18-
19-
&#x20; 2-1._**Pivot**_: Reshape the data into a wide data format.
20-
21-
&#x20; 2-2._**Pivot Table**_: Reshape the data into a wide format and apply aggregation functions if duplicate indices or columns exist.
22-
23-
&#x20; 2-3. ape the data into a long data format.
13+
2.**Reshape**_**type**_: Select a reshape type.
14+
1._**Pivot**_: Reorganize the data into a wide data format.
15+
2._**Pivot Table**_: Reorganize the data into a wide data format, and apply the_**Aggregation function**_ if there are duplicate indexes or columns.
16+
3._**Melt**_: Reorganize the data into a long data format.
2417

2518

2619

2720
***
2821

2922
###Pivot & Pivot Table
3023

24+
<figure><imgsrc="../.gitbook/assets/image (227).png"alt=""width="422"><figcaption></figcaption></figure>
3125

32-
33-
<figure><imgsrc="../.gitbook/assets/image (58).png"alt=""width="563"><figcaption></figcaption></figure>
34-
35-
1. Select the DataFrame to be reshaped into wide data.
36-
2. Choose the column to be set as the_**index**_ in the reshaped DataFrame.
37-
3. Select the column to be set as the_**columns**_ in the reshaped DataFrame.
38-
4. Choose the column to fill the_**values**_ in each column of the reshaped DataFrame.
39-
5.\[_**Pivot Table**_] Select which_**aggregation function**_ to apply for duplicate indices or columns. If multiple aggregation functions are selected, the results of each function are individually generated. For example, applying_**Count**_ and_**First**_ aggregation functions to columns A, B, and C would create six columns.
40-
6. Additional code beyond the functionalities provided by Visual Python can be added.
41-
7. Specify the variable name to assign to the result.
42-
8. Reset the index to assign a new default integer index.
43-
9. Preview the code that will be output in_**Code View**_.
44-
10. Preview the resulting DataFrame in_**Data View**_.
45-
11. Execute the code.
26+
1._**DataFrame**_: Select the dataframe that will be reconstructed_with_ wide data_._
27+
2._**Index**_: Select a column to set as the index in the reorganized dataframe.
28+
3._**Columns**_: Select the columns you want to set as columns in the reorganized dataframe.
29+
4._**Values**_: Select the columns you want to populate with values for each column in the reorganized dataframe.
30+
5._**Aggregate (Pivot Table)**_: Select the aggregation function you want to apply to the duplicate indexes or columns. If you select multiple aggregation functions, the results of each function are generated separately.&#x20;
31+
1. For example, applying the_**Count**_ and_**First**_ aggregation functions to columns A, B, and C results in a total of six columns.
32+
6._**User Option**_: You can add options beyond what Visual Python provides.
33+
7._**Allocate to**_: Specify a variable name to assign to the result.
34+
8._**Reset Index**_: Reset the index to specify a new default integer index.
35+
9._**Code View**_: Preview the code that will be output.
36+
10._**Data View**_: Preview the output to be printed.
37+
11._**Run**_: Print and run the code.
4638

4739

4840

4941
***
5042

5143
###Melt
5244

53-
54-
55-
<figure><imgsrc="../.gitbook/assets/image (59).png"alt=""width="563"><figcaption></figcaption></figure>
56-
57-
1. Select the DataFrame to be reshaped into long data.
58-
2. Choose the column(s) to be specified as fixed variables in the reshaped DataFrame. These columns will be retained as they are in the reshaped DataFrame.
59-
3. The names of the selected column(s) will be filled in the '_**A**_' column of the reshaped DataFrame, and the corresponding values from the original DataFrame will be filled in the '_**B**_' column.
60-
4. Optionally provide additional desired options.
61-
5. Specify the variable name to assign to the result.
62-
6. Reset the index to assign a new default integer index.
63-
7. Preview the code that will be output in_**Code View**_.
64-
8. Preview the resulting DataFrame in_**Data View**_.
65-
9. Execute the code.
45+
<figure><imgsrc="../.gitbook/assets/image (228).png"alt=""width="449"><figcaption></figcaption></figure>
46+
47+
1._**DataFrame**_: Select the dataframe that will be reconstructed with long data_._
48+
2._**Id**_: Select the column(s) you want to designate as fixed variables in the reorganized dataframe. These columns will remain intact in the reorganized dataframe.
49+
3. The names of the column(s) selected in_**Value** are_ populated in the_**Var name**_ column of the reconstructed dataframe, and the values are populated in the_**Value name**_ column.
50+
4._**User Option**_: You can add options beyond what Visual Python provides.
51+
5._**Allocate to**_: Specify a variable name to assign to the result.
52+
6._**Reset Index**_: Reset the index to specify a new default integer index.
53+
7._**Code View**_: Preview the code that will be output.
54+
8._**Data View**_: Preview the output that will be printed.
55+
9._**Run**_: Print and run the code.
6656

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp