@@ -41,13 +41,13 @@ What's new?
41
41
| 2 | 3 |
42
42
+ -- -+ -- -+
43
43
>> > highspeedrail = pe.Sheet()
44
- >> > sheet .json = """
44
+ >> > highspeedrail .json = """
45
45
... [{"year": 1903, "country": "Germany", "speed": "206.7km/h"},
46
46
... {"year": 1964, "country": "Japan", "speed": "210km/h"},
47
47
... {"year": 2008, "country": "China", "speed": "350km/h"}]
48
48
... """
49
- >> > sheet .name = ' High Speed Train Speed Break Through (Source: Wikipedia)'
50
- >> > sheet
49
+ >> > highspeedrail .name = ' High Speed Train Speed Break Through (Source: Wikipedia)'
50
+ >> > highspeedrail
51
51
High Speed Train Speed Break Through (Source: Wikipedia):
52
52
+ -------- -+ ---------- -+ ------ +
53
53
| country | speed | year |
@@ -58,6 +58,42 @@ What's new?
58
58
+ -------- -+ ---------- -+ ------ +
59
59
| China | 350km / h | 2008 |
60
60
+ -------- -+ ---------- -+ ------ +
61
+ >> > henley_on_thames_facts = pe.Sheet()
62
+ >> > henley_on_thames_facts.json = """
63
+ ... {"area": "5.58 square meters",
64
+ ... "population": "11,619",
65
+ ... "civial parish": "Henley-on-Thames",
66
+ ... "latitude": "51.536",
67
+ ... "longitude": "-0.898"
68
+ ... }"""
69
+ >> > henley_on_thames_facts
70
+ pyexcel sheet:
71
+ + -------------------- + ------------------ + ---------- + ---------- -+ ------------ +
72
+ | area | civial parish | latitude | longitude | population |
73
+ + -------------------- + ------------------ + ---------- + ---------- -+ ------------ +
74
+ | 5.58 square meters | Henley- on- Thames | 51.536 | - 0.898 | 11 ,619 |
75
+ + -------------------- + ------------------ + ---------- + ---------- -+ ------------ +
76
+ >> > ccs_insight = pe.Sheet()
77
+ >> > ccs_insight.name = " Worldwide Mobile Phone Shipments (Billions), 2017-2021"
78
+ >> > ccs_insight.json = """
79
+ ... {"year": ["2017", "2018", "2019", "2020", "2021"],
80
+ ... "smart phones": [1.53, 1.64, 1.74, 1.82, 1.90],
81
+ ... "feature phones": [0.46, 0.38, 0.30, 0.23, 0.17]}"""
82
+ >> > ccs_insight
83
+ pyexcel sheet:
84
+ + ---------------- + -------------- + ------ +
85
+ | feature phones | smart phones | year |
86
+ + ---------------- + -------------- + ------ +
87
+ | 0.46 | 1.53 | 2017 |
88
+ + ---------------- + -------------- + ------ +
89
+ | 0.38 | 1.64 | 2018 |
90
+ + ---------------- + -------------- + ------ +
91
+ | 0.3 | 1.74 | 2019 |
92
+ + ---------------- + -------------- + ------ +
93
+ | 0.23 | 1.82 | 2020 |
94
+ + ---------------- + -------------- + ------ +
95
+ | 0.17 | 1.9 | 2021 |
96
+ + ---------------- + -------------- + ------ +
61
97
62
98
Here is a variant of json:
63
99
@@ -79,6 +115,43 @@ Here is a variant of json:
79
115
+---------+-----------+------+
80
116
| China | 350km/h | 2008 |
81
117
+---------+-----------+------+
118
+ >>> henley_on_thames_facts2 = pe.Sheet()
119
+ >>> henley_on_thames_facts2.ndjson = """
120
+ ... {" area" : " 5.58 square meters" }
121
+ ... {" population" : " 11,619" }
122
+ ... {" civial parish" : " Henley-on-Thames" }
123
+ ... {" latitude" : " 51.536" }
124
+ ... {" longitude" : " -0.898" }
125
+ ... """ .strip()
126
+ >>> henley_on_thames_facts2
127
+ pyexcel sheet:
128
+ +---------------+--------------------+
129
+ | area | 5.58 square meters |
130
+ +---------------+--------------------+
131
+ | population | 11,619 |
132
+ +---------------+--------------------+
133
+ | civial parish | Henley-on-Thames |
134
+ +---------------+--------------------+
135
+ | latitude | 51.536 |
136
+ +---------------+--------------------+
137
+ | longitude | -0.898 |
138
+ +---------------+--------------------+
139
+ >>> ccs_insight2 = pe.Sheet()
140
+ >>> ccs_insight2.name = " Worldwide Mobile Phone Shipments (Billions), 2017-2021"
141
+ >>> ccs_insight2.ndjson = """
142
+ ... {" year" : [" 2017" , " 2018" , " 2019" , " 2020" , " 2021" ]}
143
+ ... {" smart phones" : [1.53 , 1.64 , 1.74 , 1.82 , 1.90 ]}
144
+ ... {" feature phones" : [0.46 , 0.38 , 0.30 , 0.23 , 0.17 ]}
145
+ ... """ .strip()
146
+ >>> ccs_insight2
147
+ pyexcel sheet:
148
+ +----------------+------+------+------+------+------+
149
+ | year | 2017 | 2018 | 2019 | 2020 | 2021 |
150
+ +----------------+------+------+------+------+------+
151
+ | smart phones | 1.53 | 1.64 | 1.74 | 1.82 | 1.9 |
152
+ +----------------+------+------+------+------+------+
153
+ | feature phones | 0.46 | 0.38 | 0.3 | 0.23 | 0.17 |
154
+ +----------------+------+------+------+------+------+
82
155
83
156
84
157
Simple
0 commit comments