Real IT problem solving

What is often missing from PowerPoint presentations and other possibily usefull notes

Real IT problem solving Uncategorized Python dataframes selection for people with SQL background

Python dataframes selection for people with SQL background

SELECT column_name FROM data_frame

df[[‘column_name’]]

SELECT column_name FROM data_frame LIMIT 10

df[[‘column_name’]].head(10)

SELECT * FROM data_frame WHERE column_name = ‘value’

df[(df[‘column_name’] == ‘value’)]

SELECT column_name FROM data_frame WHERE co1_name = ‘value2’ AND col2_name = ‘value2’

df[[‘column_name’]][(df[‘col1_name’] == ‘value1’) & (df[‘col2_name’] == ‘value2’)].head(100)

SELECT date_part, count(*) FROM data_frame GROUP BY date_part – for dataframes with DatetimeIndex

To count column “column_name” by weeks (W)

df.resample(‘W’).agg({“column_name”:’size’})

SELECT date_part, count(*) FROM data_frame WHERE column_name = ‘col_value’ GROUP BY date_part ORDER BY count(*) DESC LIMIT 10 – for dataframes with DatetimeIndex

To count column “column_name” by minutes (1T)

df[(df[‘column_name’] == ‘col_value’)].resample(‘1T’).agg({“column_name”:’size’}).sort_values(by=’column_name’, ascending=False).head(10)

0 thoughts on “Python dataframes selection for people with SQL background”

  1. DavidWor says:
    Your comment is awaiting moderation. This is a preview, your comment will be visible after it has been approved.

    High-quality service makes the certified website of competitive at the international level. Players bribe round-the-clock access to the resource. Do you want to be a party to b manipulate roulette or poker with live dealers — it’s possible at any point! Complex promote is always in touch and enthusiastic to promptly answer any questions from players. The entrance to is accessible to all players. Creating an account opens up a destiny of additional features. So users resolution be able to lightly for money and start all the bonuses offered. To carry out a scratch account, in supplement to the conventional registration, the player requirement require scans of documents confirming his indistinguishability and bona fide age. All additional options whim be opened solely after checking the documents at near the casino security service pin up ua https://pin-up-casino-bet.com/kz

Leave a Reply

Your email address will not be published. Required fields are marked *

TopBack to Top