[PYTHON] Developed a simple spreadsheet app for people who are not good at Excel

I developed a spreadsheet app in Python. I'm using NumPy and pandas.

Spreadsheet App

How to use

The following data is used for explanation.

Country	Area	Population
Russia	17,098,242	145,934,462
Canada	9,984,670	37,742,154
United States	9,833,517	331,002,651
China	9,596,960	1,439,323,776
Brazil	8,515,770	212,559,417
Australia	7,741,220	25,499,884

Data source Countries in the world by population (2020)

Column extraction

If you put a column name between [ and ], that column will be extracted. You can extract multiple columns separated by commas. For example, t [Country, Area] extracts the Country and Area columns.

Extraction of rows

If you use [: 3], the 0th to 3rd lines will be extracted. You can get the same result by doing [0: 3].

Type [2:] to extract all lines from the third line. That is, the lines up to the second line are deleted.

If you enter t [2], only the United States on the third line will be extracted as shown in the figure below.

sort

If you add a hyphen - to the column name, it will be sorted by that column. One hyphen is in ascending order.

As shown in the figure below, two hyphens are in descending order. China is at the top.

Add new column

Put a column name and expression after & to add a new column.

In the figure above, a column called population density is added. The formula is Density = Population / Area.

Example of combining the functions so far

An example of adding a population density column, removing the area column, sorting by population density, and extracting the top three countries.

command

t &Density=Population/Area [Country,Population,Density] --Density [:3]

statistics

You can optionally enter functions such as mean and variance. a is the average. Just type t a to get the average for each column.

Option list

a average median median mode mode var distribution std standard deviation

Formula

In the above example, we added columns with the formula Density = Population / Area, but advanced functions can also be entered intuitively.

Nested functions are also supported. Most standard functions such as trigonometric functions are included. Exponentiation uses ** instead of ^.

Figure

I've used t so far, but you can use g to display the figure. Since the graph is under development, only the primitive Matplotlib graph is displayed. Also, you cannot connect to the t command.

For graphs, enter options such as line in the g command. Currently, only two columns of data can be displayed in a bar graph and a line graph.

Advantages of this app

Spreadsheet app Spreadsheet

Official page Math-Serif

Disadvantages of this app

All documentation is written in English, but spreadsheet apps all work with the t command. Of course, the input data and output data are not saved in the server.

Recommended Posts

Developed a simple spreadsheet app for people who are not good at Excel
Infrastructure automation tool Ansible for people who are not good at Ruby
Java SE8 Gold measures (for those who are not good at it)
To people who are "recruiting but not recruiting"
[YOLO v5] Object detection for people who are masked and those who are not
Machine learning A story about people who are not familiar with GBDT using GBDT in Python