Summarize data by column direction

Example

There is an Excel file Book1.xlsx, the data is as follows:

From a certain test score of the three classes, sum up the number of each class and the total scores of all subjects (including mathematics, English, and PE):

Write SPL script:

Method 1: Structured data

A1 Read Excel data

A2 Group by class, calculate the number of people in each class, num, the total score of all subjects (columns 3 to 5), total, where ${to(3,5).(“#”/~).concat(“+”)} combine into text: #3+#4+#5

A3 Export result A2 to result.xlsx

Method 2: Two-dimensional array

A1 Read Excel data, start reading from the second row, and read it as a two-dimensional array

A2 Group by class (first column), calculate the number of people in each class, num, the total scores of all subjects (from the third column), total

A3 Export result A2 to result.xlsx

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Starbucks should really make their APIs public.

To avoid confusion about the direction of an axis in Python Pandas

Python chat with encryption

Creating Objective Support & Resistance Lines in TradingView.

Deploying your first API on Heroku

Script: Dynamically Updating Text Ads With Current Prices — Part 1

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
chuxin huo

chuxin huo

hello:)

More from Medium

Sparkify Capstone Project

Data preprocessing for Associate Rule Mining

What data and data science can show us about student performance.

Data Science at EDA — Working hard with pandas, seaborn and Matplotlib