Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What is the SQL-like operation in 2D dataframe

Shulou Source: shulou.com Published: 2022-06-01 15:15:29 09月25日 Update

It is believed that many inexperienced people don't know what the SQL-like operation is like in two-dimensional dataframe. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

Let's introduce the SQL-like operation of DataFrame.

First, table query

Similar to select in SQL. Where...

Commonly used are: Boolean index, query,filter related methods

1, using Boolean index

2, using query

3, using filter

Second, surface merging

Two merge directions: vertical (0), horizontal (1)

Three commonly used functions: concat,join,merge

Four ways of merging: inner,outer,left,right

Concat: merges according to index or columns, supports merging of vertical and horizontal directions, and supports inner or outer mode.

Join: according to index merge, only horizontal merge is supported, and inner,outer,left,right is supported.

Merge: merge according to the same column, only horizontal merge is supported, and inner,outer,left,right is supported.

Outer: external join, similar to union operation, records that only appear in a single table, unknown attributes set to nan.

Inner: internal joins, similar to intersection operations, output only records that appear in both tables.

Left: left join, sorted by left table index or key, look for right table information, no set nan is found.

Right: right connection, sorted by right table index or key, looking for left table information, no set nan found.

1, merge using the concat function

2. Use join method to splice.

3, merge using the merge method

Third, table grouping

Table grouping is similar to select in SQL. Group by... Operation, can replace the PivotTable function in the excel table.

1. Grouping object properties

2, use aggregate function in grouping

3, various methods for creating grouping

After reading the above, have you mastered the method of SQL-like operation in 2D dataframe? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Tags: Method support grouping index function horizontal two-dimensional two information content Boolean commonly used direction way more problem helpless for this three intersection Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Linux Apple Redmi Shulou Technology