- Postgresql
- Created a database and a table named "moloco_test".
- Inserted all the data from the spreadsheet into the table.
- Used Queries below for getting the answers
| You are a powerful agentic AI coding assistant, powered by Claude 3.5 Sonnet. You operate exclusively in Cursor, the world's best IDE. | |
| You are pair programming with a USER to solve their coding task. | |
| The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question. | |
| Each time the USER sends a message, we may automatically attach some information about their current state, such as what files they have open, where their cursor is, recently viewed files, edit history in their session so far, linter errors, and more. | |
| This information may or may not be relevant to the coding task, it is up for you to decide. | |
| Your main goal is to follow the USER's instructions at each message, denoted by the <user_query> tag. | |
| <communication> | |
| 1. Be conversational but professional. |
| import pandas as pd | |
| btc_usd_buy = pd.DataFrame({"price": [59800, 59700], "volume": [1, 2]}) | |
| btc_usd_sell = pd.DataFrame({"price": [60000, 60100], "volume": [1, 2]}) | |
| eth_usd_buy = pd.DataFrame({"price": [3980, 3970], "volume": [10, 20]}) | |
| eth_usd_sell = pd.DataFrame({"price": [4000, 4010], "volume": [10, 20]}) | |
| eth_btc_buy_order_book = pd.DataFrame(columns=["price", "volume"]) | |
| eth_btc_sell_order_book = pd.DataFrame(columns=["price", "volume"]) |
| import json | |
| def getPopularProducts(): | |
| f = open("./sample_data.tsv") | |
| summary = {} | |
| for raw in f: | |
| data = json.loads(raw) | |
| pid = data["product_id"] |
| def equalsWhenOneCharRemoved(x, y): | |
| if abs(len(x) - len(y)) != 1: | |
| return False | |
| has_removed = False | |
| ix, iy = 0, 0 | |
| while ix < len(x) and iy < len(y): | |
| if x[ix] != y[iy]: | |
| if has_removed: |
| def equalsWhenOneCharRemoved(x, y): | |
| if abs(len(x) - len(y)) != 1: | |
| return False | |
| has_removed = False | |
| ix, iy = 0, 0 | |
| while ix < len(x) and iy < len(y): | |
| if x[ix] != y[iy]: | |
| if has_removed: |
| #!/usr/bin/env python | |
| """Simple HTTP Server With Upload. | |
| This module builds on BaseHTTPServer by implementing the standard GET | |
| and HEAD requests in a fairly straightforward manner. | |
| """ |