Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the SQL-like operation in 2D dataframe

2025-01-20 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report