Dataset Viewer
semeval_id
int32 0
319
| question
stringlengths 23
161
| dataset
stringclasses 16
values | split
stringclasses 1
value | predicted_type
stringclasses 5
values | predicted_columns
stringlengths 6
161
| phase
stringclasses 1
value | content
stringlengths 2.99k
55.1k
| update_timestamp
stringclasses 15
values |
---|---|---|---|---|---|---|---|---|
0 |
Is the most favorited author mainly communicating in Spanish?
|
050_ING
|
dev
|
boolean
|
['favorites', 'lang']
|
dev
|
# Instructions: Generate ONLY python code. Do not include explanations.
# you can use pandas and numpy. Use the meta data information from df_schema, df_descprtion.
import pandas as pd
import numpy as np
# Description of dataframe schema.
df_schema = {
"columns": [
{
"name": "id",
"type": "int64"
},
{
"name": "author_id",
"type": "int64"
},
{
"name": "author_name",
"type": "category"
},
{
"name": "author_handler",
"type": "category"
},
{
"name": "author_avatar",
"type": "category"
},
{
"name": "lang",
"type": "category"
},
{
"name": "type",
"type": "category"
},
{
"name": "text",
"type": "object"
},
{
"name": "date",
"type": "datetime64[ns, UTC]"
},
{
"name": "mention_ids",
"type": "object"
},
{
"name": "mention_names",
"type": "object"
},
{
"name": "retweets",
"type": "uint8"
},
{
"name": "favorites",
"type": "uint8"
},
{
"name": "links",
"type": "object"
},
{
"name": "links_first",
"type": "category"
},
{
"name": "image_links",
"type": "object"
},
{
"name": "image_links_first",
"type": "category"
},
{
"name": "rp_user_id",
"type": "float64"
},
{
"name": "rp_user_name",
"type": "category"
},
{
"name": "location",
"type": "category"
},
{
"name": "tweet_link",
"type": "category"
},
{
"name": "search",
"type": "category"
}
]
}
# Description of dataframe columns.
df_descrption = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
# Randome sample of 10 rows from the dataframe.
df_random_sample = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
'''
The question categories are:
- boolean: Valid answers include True/False, Y/N, Yes/No (all case insensitive).
- category: A value from a cell (or a substring of a cell) in the dataset.
- number: A numerical value from a cell in the dataset, which may represent a computed statistic (e.g., average, maximum, minimum).
- list[category]: A list containing a fixed number of categories. The expected format is: "['cat', 'dog']". Pay attention to the wording of the question to determine if uniqueness is required or if repeated values are allowed.
- list[number]: Similar to list[category], but with numbers as its elements.
'''
# TODO: complete the following function in one line, by completing the return statement. It should give the answer to: How many rows are there in this dataframe?
def example(df: pd.DataFrame):
df.columns=["A"]
# Expected output type: is number, this will be checked.
return df.shape[0]
# It should give the answer to: Is the most favorited author mainly communicating in Spanish?
# The answer should only contain python code, you are not allowed leave any TODO undone.
def answer(df: pd.DataFrame):
# Use df to answer: Is the most favorited author mainly communicating in Spanish?
df.columns = ['id', 'author_id', 'author_name', 'author_handler', 'author_avatar', 'lang', 'type', 'text', 'date', 'mention_ids', 'mention_names', 'retweets', 'favorites', 'links', 'links_first', 'image_links', 'image_links_first', 'rp_user_id', 'rp_user_name', 'location', 'tweet_link', 'search']
# Expected output type: is boolean, this will be checked.
return
|
20250129013714
|
1 |
Does the author with the longest name post mainly original content?
|
050_ING
|
dev
|
boolean
|
['author_name', 'type']
|
dev
|
# Instructions: Generate ONLY python code. Do not include explanations.
# you can use pandas and numpy. Use the meta data information from df_schema, df_descprtion.
import pandas as pd
import numpy as np
# Description of dataframe schema.
df_schema = {
"columns": [
{
"name": "id",
"type": "int64"
},
{
"name": "author_id",
"type": "int64"
},
{
"name": "author_name",
"type": "category"
},
{
"name": "author_handler",
"type": "category"
},
{
"name": "author_avatar",
"type": "category"
},
{
"name": "lang",
"type": "category"
},
{
"name": "type",
"type": "category"
},
{
"name": "text",
"type": "object"
},
{
"name": "date",
"type": "datetime64[ns, UTC]"
},
{
"name": "mention_ids",
"type": "object"
},
{
"name": "mention_names",
"type": "object"
},
{
"name": "retweets",
"type": "uint8"
},
{
"name": "favorites",
"type": "uint8"
},
{
"name": "links",
"type": "object"
},
{
"name": "links_first",
"type": "category"
},
{
"name": "image_links",
"type": "object"
},
{
"name": "image_links_first",
"type": "category"
},
{
"name": "rp_user_id",
"type": "float64"
},
{
"name": "rp_user_name",
"type": "category"
},
{
"name": "location",
"type": "category"
},
{
"name": "tweet_link",
"type": "category"
},
{
"name": "search",
"type": "category"
}
]
}
# Description of dataframe columns.
df_descrption = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
# Randome sample of 10 rows from the dataframe.
df_random_sample = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
'''
The question categories are:
- boolean: Valid answers include True/False, Y/N, Yes/No (all case insensitive).
- category: A value from a cell (or a substring of a cell) in the dataset.
- number: A numerical value from a cell in the dataset, which may represent a computed statistic (e.g., average, maximum, minimum).
- list[category]: A list containing a fixed number of categories. The expected format is: "['cat', 'dog']". Pay attention to the wording of the question to determine if uniqueness is required or if repeated values are allowed.
- list[number]: Similar to list[category], but with numbers as its elements.
'''
# TODO: complete the following function in one line, by completing the return statement. It should give the answer to: How many rows are there in this dataframe?
def example(df: pd.DataFrame):
df.columns=["A"]
# Expected output type: is number, this will be checked.
return df.shape[0]
# It should give the answer to: Does the author with the longest name post mainly original content?
# The answer should only contain python code, you are not allowed leave any TODO undone.
def answer(df: pd.DataFrame):
# Use df to answer: Does the author with the longest name post mainly original content?
df.columns = ['id', 'author_id', 'author_name', 'author_handler', 'author_avatar', 'lang', 'type', 'text', 'date', 'mention_ids', 'mention_names', 'retweets', 'favorites', 'links', 'links_first', 'image_links', 'image_links_first', 'rp_user_id', 'rp_user_name', 'location', 'tweet_link', 'search']
# Expected output type: is boolean, this will be checked.
return
|
20250129013714
|
2 |
Is there an author who received no retweets for any of their posts?
|
050_ING
|
dev
|
boolean
|
['author_name', 'retweets']
|
dev
|
# Instructions: Generate ONLY python code. Do not include explanations.
# you can use pandas and numpy. Use the meta data information from df_schema, df_descprtion.
import pandas as pd
import numpy as np
# Description of dataframe schema.
df_schema = {
"columns": [
{
"name": "id",
"type": "int64"
},
{
"name": "author_id",
"type": "int64"
},
{
"name": "author_name",
"type": "category"
},
{
"name": "author_handler",
"type": "category"
},
{
"name": "author_avatar",
"type": "category"
},
{
"name": "lang",
"type": "category"
},
{
"name": "type",
"type": "category"
},
{
"name": "text",
"type": "object"
},
{
"name": "date",
"type": "datetime64[ns, UTC]"
},
{
"name": "mention_ids",
"type": "object"
},
{
"name": "mention_names",
"type": "object"
},
{
"name": "retweets",
"type": "uint8"
},
{
"name": "favorites",
"type": "uint8"
},
{
"name": "links",
"type": "object"
},
{
"name": "links_first",
"type": "category"
},
{
"name": "image_links",
"type": "object"
},
{
"name": "image_links_first",
"type": "category"
},
{
"name": "rp_user_id",
"type": "float64"
},
{
"name": "rp_user_name",
"type": "category"
},
{
"name": "location",
"type": "category"
},
{
"name": "tweet_link",
"type": "category"
},
{
"name": "search",
"type": "category"
}
]
}
# Description of dataframe columns.
df_descrption = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
# Randome sample of 10 rows from the dataframe.
df_random_sample = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
'''
The question categories are:
- boolean: Valid answers include True/False, Y/N, Yes/No (all case insensitive).
- category: A value from a cell (or a substring of a cell) in the dataset.
- number: A numerical value from a cell in the dataset, which may represent a computed statistic (e.g., average, maximum, minimum).
- list[category]: A list containing a fixed number of categories. The expected format is: "['cat', 'dog']". Pay attention to the wording of the question to determine if uniqueness is required or if repeated values are allowed.
- list[number]: Similar to list[category], but with numbers as its elements.
'''
# TODO: complete the following function in one line, by completing the return statement. It should give the answer to: How many rows are there in this dataframe?
def example(df: pd.DataFrame):
df.columns=["A"]
# Expected output type: is number, this will be checked.
return df.shape[0]
# It should give the answer to: Is there an author who received no retweets for any of their posts?
# The answer should only contain python code, you are not allowed leave any TODO undone.
def answer(df: pd.DataFrame):
# Use df to answer: Is there an author who received no retweets for any of their posts?
df.columns = ['id', 'author_id', 'author_name', 'author_handler', 'author_avatar', 'lang', 'type', 'text', 'date', 'mention_ids', 'mention_names', 'retweets', 'favorites', 'links', 'links_first', 'image_links', 'image_links_first', 'rp_user_id', 'rp_user_name', 'location', 'tweet_link', 'search']
# Expected output type: is boolean, this will be checked.
return
|
20250129013714
|
3 |
Are there any posts that do not contain any links?
|
050_ING
|
dev
|
boolean
|
['links']
|
dev
|
# Instructions: Generate ONLY python code. Do not include explanations.
# you can use pandas and numpy. Use the meta data information from df_schema, df_descprtion.
import pandas as pd
import numpy as np
# Description of dataframe schema.
df_schema = {
"columns": [
{
"name": "id",
"type": "int64"
},
{
"name": "author_id",
"type": "int64"
},
{
"name": "author_name",
"type": "category"
},
{
"name": "author_handler",
"type": "category"
},
{
"name": "author_avatar",
"type": "category"
},
{
"name": "lang",
"type": "category"
},
{
"name": "type",
"type": "category"
},
{
"name": "text",
"type": "object"
},
{
"name": "date",
"type": "datetime64[ns, UTC]"
},
{
"name": "mention_ids",
"type": "object"
},
{
"name": "mention_names",
"type": "object"
},
{
"name": "retweets",
"type": "uint8"
},
{
"name": "favorites",
"type": "uint8"
},
{
"name": "links",
"type": "object"
},
{
"name": "links_first",
"type": "category"
},
{
"name": "image_links",
"type": "object"
},
{
"name": "image_links_first",
"type": "category"
},
{
"name": "rp_user_id",
"type": "float64"
},
{
"name": "rp_user_name",
"type": "category"
},
{
"name": "location",
"type": "category"
},
{
"name": "tweet_link",
"type": "category"
},
{
"name": "search",
"type": "category"
}
]
}
# Description of dataframe columns.
df_descrption = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
# Randome sample of 10 rows from the dataframe.
df_random_sample = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
'''
The question categories are:
- boolean: Valid answers include True/False, Y/N, Yes/No (all case insensitive).
- category: A value from a cell (or a substring of a cell) in the dataset.
- number: A numerical value from a cell in the dataset, which may represent a computed statistic (e.g., average, maximum, minimum).
- list[category]: A list containing a fixed number of categories. The expected format is: "['cat', 'dog']". Pay attention to the wording of the question to determine if uniqueness is required or if repeated values are allowed.
- list[number]: Similar to list[category], but with numbers as its elements.
'''
# TODO: complete the following function in one line, by completing the return statement. It should give the answer to: How many rows are there in this dataframe?
def example(df: pd.DataFrame):
df.columns=["A"]
# Expected output type: is number, this will be checked.
return df.shape[0]
# It should give the answer to: Are there any posts that do not contain any links?
# The answer should only contain python code, you are not allowed leave any TODO undone.
def answer(df: pd.DataFrame):
# Use df to answer: Are there any posts that do not contain any links?
df.columns = ['id', 'author_id', 'author_name', 'author_handler', 'author_avatar', 'lang', 'type', 'text', 'date', 'mention_ids', 'mention_names', 'retweets', 'favorites', 'links', 'links_first', 'image_links', 'image_links_first', 'rp_user_id', 'rp_user_name', 'location', 'tweet_link', 'search']
# Expected output type: is boolean, this will be checked.
return
|
20250129013714
|
4 |
How many unique authors are in the dataset?
|
050_ING
|
dev
|
number
|
['author_name']
|
dev
|
# Instructions: Generate ONLY python code. Do not include explanations.
# you can use pandas and numpy. Use the meta data information from df_schema, df_descprtion.
import pandas as pd
import numpy as np
# Description of dataframe schema.
df_schema = {
"columns": [
{
"name": "id",
"type": "int64"
},
{
"name": "author_id",
"type": "int64"
},
{
"name": "author_name",
"type": "category"
},
{
"name": "author_handler",
"type": "category"
},
{
"name": "author_avatar",
"type": "category"
},
{
"name": "lang",
"type": "category"
},
{
"name": "type",
"type": "category"
},
{
"name": "text",
"type": "object"
},
{
"name": "date",
"type": "datetime64[ns, UTC]"
},
{
"name": "mention_ids",
"type": "object"
},
{
"name": "mention_names",
"type": "object"
},
{
"name": "retweets",
"type": "uint8"
},
{
"name": "favorites",
"type": "uint8"
},
{
"name": "links",
"type": "object"
},
{
"name": "links_first",
"type": "category"
},
{
"name": "image_links",
"type": "object"
},
{
"name": "image_links_first",
"type": "category"
},
{
"name": "rp_user_id",
"type": "float64"
},
{
"name": "rp_user_name",
"type": "category"
},
{
"name": "location",
"type": "category"
},
{
"name": "tweet_link",
"type": "category"
},
{
"name": "search",
"type": "category"
}
]
}
# Description of dataframe columns.
df_descrption = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
# Randome sample of 10 rows from the dataframe.
df_random_sample = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
'''
The question categories are:
- boolean: Valid answers include True/False, Y/N, Yes/No (all case insensitive).
- category: A value from a cell (or a substring of a cell) in the dataset.
- number: A numerical value from a cell in the dataset, which may represent a computed statistic (e.g., average, maximum, minimum).
- list[category]: A list containing a fixed number of categories. The expected format is: "['cat', 'dog']". Pay attention to the wording of the question to determine if uniqueness is required or if repeated values are allowed.
- list[number]: Similar to list[category], but with numbers as its elements.
'''
# TODO: complete the following function in one line, by completing the return statement. It should give the answer to: How many rows are there in this dataframe?
def example(df: pd.DataFrame):
df.columns=["A"]
# Expected output type: is number, this will be checked.
return df.shape[0]
# It should give the answer to: How many unique authors are in the dataset?
# The answer should only contain python code, you are not allowed leave any TODO undone.
def answer(df: pd.DataFrame):
# Use df to answer: How many unique authors are in the dataset?
df.columns = ['id', 'author_id', 'author_name', 'author_handler', 'author_avatar', 'lang', 'type', 'text', 'date', 'mention_ids', 'mention_names', 'retweets', 'favorites', 'links', 'links_first', 'image_links', 'image_links_first', 'rp_user_id', 'rp_user_name', 'location', 'tweet_link', 'search']
# Expected output type: is number, this will be checked.
return
|
20250129013714
|
5 |
What is the length of the longest post (based on the number of words)?
|
050_ING
|
dev
|
number
|
['text']
|
dev
|
# Instructions: Generate ONLY python code. Do not include explanations.
# you can use pandas and numpy. Use the meta data information from df_schema, df_descprtion.
import pandas as pd
import numpy as np
# Description of dataframe schema.
df_schema = {
"columns": [
{
"name": "id",
"type": "int64"
},
{
"name": "author_id",
"type": "int64"
},
{
"name": "author_name",
"type": "category"
},
{
"name": "author_handler",
"type": "category"
},
{
"name": "author_avatar",
"type": "category"
},
{
"name": "lang",
"type": "category"
},
{
"name": "type",
"type": "category"
},
{
"name": "text",
"type": "object"
},
{
"name": "date",
"type": "datetime64[ns, UTC]"
},
{
"name": "mention_ids",
"type": "object"
},
{
"name": "mention_names",
"type": "object"
},
{
"name": "retweets",
"type": "uint8"
},
{
"name": "favorites",
"type": "uint8"
},
{
"name": "links",
"type": "object"
},
{
"name": "links_first",
"type": "category"
},
{
"name": "image_links",
"type": "object"
},
{
"name": "image_links_first",
"type": "category"
},
{
"name": "rp_user_id",
"type": "float64"
},
{
"name": "rp_user_name",
"type": "category"
},
{
"name": "location",
"type": "category"
},
{
"name": "tweet_link",
"type": "category"
},
{
"name": "search",
"type": "category"
}
]
}
# Description of dataframe columns.
df_descrption = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
# Randome sample of 10 rows from the dataframe.
df_random_sample = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
'''
The question categories are:
- boolean: Valid answers include True/False, Y/N, Yes/No (all case insensitive).
- category: A value from a cell (or a substring of a cell) in the dataset.
- number: A numerical value from a cell in the dataset, which may represent a computed statistic (e.g., average, maximum, minimum).
- list[category]: A list containing a fixed number of categories. The expected format is: "['cat', 'dog']". Pay attention to the wording of the question to determine if uniqueness is required or if repeated values are allowed.
- list[number]: Similar to list[category], but with numbers as its elements.
'''
# TODO: complete the following function in one line, by completing the return statement. It should give the answer to: How many rows are there in this dataframe?
def example(df: pd.DataFrame):
df.columns=["A"]
# Expected output type: is number, this will be checked.
return df.shape[0]
# It should give the answer to: What is the length of the longest post (based on the number of words)?
# The answer should only contain python code, you are not allowed leave any TODO undone.
def answer(df: pd.DataFrame):
# Use df to answer: What is the length of the longest post (based on the number of words)?
df.columns = ['id', 'author_id', 'author_name', 'author_handler', 'author_avatar', 'lang', 'type', 'text', 'date', 'mention_ids', 'mention_names', 'retweets', 'favorites', 'links', 'links_first', 'image_links', 'image_links_first', 'rp_user_id', 'rp_user_name', 'location', 'tweet_link', 'search']
# Expected output type: is number, this will be checked.
return
|
20250129013714
|
6 |
What is the total number of retweets received by all authors in the dataset?
|
050_ING
|
dev
|
number
|
['retweets']
|
dev
|
# Instructions: Generate ONLY python code. Do not include explanations.
# you can use pandas and numpy. Use the meta data information from df_schema, df_descprtion.
import pandas as pd
import numpy as np
# Description of dataframe schema.
df_schema = {
"columns": [
{
"name": "id",
"type": "int64"
},
{
"name": "author_id",
"type": "int64"
},
{
"name": "author_name",
"type": "category"
},
{
"name": "author_handler",
"type": "category"
},
{
"name": "author_avatar",
"type": "category"
},
{
"name": "lang",
"type": "category"
},
{
"name": "type",
"type": "category"
},
{
"name": "text",
"type": "object"
},
{
"name": "date",
"type": "datetime64[ns, UTC]"
},
{
"name": "mention_ids",
"type": "object"
},
{
"name": "mention_names",
"type": "object"
},
{
"name": "retweets",
"type": "uint8"
},
{
"name": "favorites",
"type": "uint8"
},
{
"name": "links",
"type": "object"
},
{
"name": "links_first",
"type": "category"
},
{
"name": "image_links",
"type": "object"
},
{
"name": "image_links_first",
"type": "category"
},
{
"name": "rp_user_id",
"type": "float64"
},
{
"name": "rp_user_name",
"type": "category"
},
{
"name": "location",
"type": "category"
},
{
"name": "tweet_link",
"type": "category"
},
{
"name": "search",
"type": "category"
}
]
}
# Description of dataframe columns.
df_descrption = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
# Randome sample of 10 rows from the dataframe.
df_random_sample = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
'''
The question categories are:
- boolean: Valid answers include True/False, Y/N, Yes/No (all case insensitive).
- category: A value from a cell (or a substring of a cell) in the dataset.
- number: A numerical value from a cell in the dataset, which may represent a computed statistic (e.g., average, maximum, minimum).
- list[category]: A list containing a fixed number of categories. The expected format is: "['cat', 'dog']". Pay attention to the wording of the question to determine if uniqueness is required or if repeated values are allowed.
- list[number]: Similar to list[category], but with numbers as its elements.
'''
# TODO: complete the following function in one line, by completing the return statement. It should give the answer to: How many rows are there in this dataframe?
def example(df: pd.DataFrame):
df.columns=["A"]
# Expected output type: is number, this will be checked.
return df.shape[0]
# It should give the answer to: What is the total number of retweets received by all authors in the dataset?
# The answer should only contain python code, you are not allowed leave any TODO undone.
def answer(df: pd.DataFrame):
# Use df to answer: What is the total number of retweets received by all authors in the dataset?
df.columns = ['id', 'author_id', 'author_name', 'author_handler', 'author_avatar', 'lang', 'type', 'text', 'date', 'mention_ids', 'mention_names', 'retweets', 'favorites', 'links', 'links_first', 'image_links', 'image_links_first', 'rp_user_id', 'rp_user_name', 'location', 'tweet_link', 'search']
# Expected output type: is number, this will be checked.
return
|
20250129013714
|
7 |
How many posts do not contain any mentions of other users?
|
050_ING
|
dev
|
number
|
['mention_ids']
|
dev
|
# Instructions: Generate ONLY python code. Do not include explanations.
# you can use pandas and numpy. Use the meta data information from df_schema, df_descprtion.
import pandas as pd
import numpy as np
# Description of dataframe schema.
df_schema = {
"columns": [
{
"name": "id",
"type": "int64"
},
{
"name": "author_id",
"type": "int64"
},
{
"name": "author_name",
"type": "category"
},
{
"name": "author_handler",
"type": "category"
},
{
"name": "author_avatar",
"type": "category"
},
{
"name": "lang",
"type": "category"
},
{
"name": "type",
"type": "category"
},
{
"name": "text",
"type": "object"
},
{
"name": "date",
"type": "datetime64[ns, UTC]"
},
{
"name": "mention_ids",
"type": "object"
},
{
"name": "mention_names",
"type": "object"
},
{
"name": "retweets",
"type": "uint8"
},
{
"name": "favorites",
"type": "uint8"
},
{
"name": "links",
"type": "object"
},
{
"name": "links_first",
"type": "category"
},
{
"name": "image_links",
"type": "object"
},
{
"name": "image_links_first",
"type": "category"
},
{
"name": "rp_user_id",
"type": "float64"
},
{
"name": "rp_user_name",
"type": "category"
},
{
"name": "location",
"type": "category"
},
{
"name": "tweet_link",
"type": "category"
},
{
"name": "search",
"type": "category"
}
]
}
# Description of dataframe columns.
df_descrption = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
# Randome sample of 10 rows from the dataframe.
df_random_sample = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
'''
The question categories are:
- boolean: Valid answers include True/False, Y/N, Yes/No (all case insensitive).
- category: A value from a cell (or a substring of a cell) in the dataset.
- number: A numerical value from a cell in the dataset, which may represent a computed statistic (e.g., average, maximum, minimum).
- list[category]: A list containing a fixed number of categories. The expected format is: "['cat', 'dog']". Pay attention to the wording of the question to determine if uniqueness is required or if repeated values are allowed.
- list[number]: Similar to list[category], but with numbers as its elements.
'''
# TODO: complete the following function in one line, by completing the return statement. It should give the answer to: How many rows are there in this dataframe?
def example(df: pd.DataFrame):
df.columns=["A"]
# Expected output type: is number, this will be checked.
return df.shape[0]
# It should give the answer to: How many posts do not contain any mentions of other users?
# The answer should only contain python code, you are not allowed leave any TODO undone.
def answer(df: pd.DataFrame):
# Use df to answer: How many posts do not contain any mentions of other users?
df.columns = ['id', 'author_id', 'author_name', 'author_handler', 'author_avatar', 'lang', 'type', 'text', 'date', 'mention_ids', 'mention_names', 'retweets', 'favorites', 'links', 'links_first', 'image_links', 'image_links_first', 'rp_user_id', 'rp_user_name', 'location', 'tweet_link', 'search']
# Expected output type: is number, this will be checked.
return
|
20250129013714
|
8 |
What is the name of the author with the most retweeted single tweet?
|
050_ING
|
dev
|
category
|
['author_name', 'retweets']
|
dev
|
# Instructions: Generate ONLY python code. Do not include explanations.
# you can use pandas and numpy. Use the meta data information from df_schema, df_descprtion.
import pandas as pd
import numpy as np
# Description of dataframe schema.
df_schema = {
"columns": [
{
"name": "id",
"type": "int64"
},
{
"name": "author_id",
"type": "int64"
},
{
"name": "author_name",
"type": "category"
},
{
"name": "author_handler",
"type": "category"
},
{
"name": "author_avatar",
"type": "category"
},
{
"name": "lang",
"type": "category"
},
{
"name": "type",
"type": "category"
},
{
"name": "text",
"type": "object"
},
{
"name": "date",
"type": "datetime64[ns, UTC]"
},
{
"name": "mention_ids",
"type": "object"
},
{
"name": "mention_names",
"type": "object"
},
{
"name": "retweets",
"type": "uint8"
},
{
"name": "favorites",
"type": "uint8"
},
{
"name": "links",
"type": "object"
},
{
"name": "links_first",
"type": "category"
},
{
"name": "image_links",
"type": "object"
},
{
"name": "image_links_first",
"type": "category"
},
{
"name": "rp_user_id",
"type": "float64"
},
{
"name": "rp_user_name",
"type": "category"
},
{
"name": "location",
"type": "category"
},
{
"name": "tweet_link",
"type": "category"
},
{
"name": "search",
"type": "category"
}
]
}
# Description of dataframe columns.
df_descrption = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
# Randome sample of 10 rows from the dataframe.
df_random_sample = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
'''
The question categories are:
- boolean: Valid answers include True/False, Y/N, Yes/No (all case insensitive).
- category: A value from a cell (or a substring of a cell) in the dataset.
- number: A numerical value from a cell in the dataset, which may represent a computed statistic (e.g., average, maximum, minimum).
- list[category]: A list containing a fixed number of categories. The expected format is: "['cat', 'dog']". Pay attention to the wording of the question to determine if uniqueness is required or if repeated values are allowed.
- list[number]: Similar to list[category], but with numbers as its elements.
'''
# TODO: complete the following function in one line, by completing the return statement. It should give the answer to: How many rows are there in this dataframe?
def example(df: pd.DataFrame):
df.columns=["A"]
# Expected output type: is number, this will be checked.
return df.shape[0]
# It should give the answer to: What is the name of the author with the most retweeted single tweet?
# The answer should only contain python code, you are not allowed leave any TODO undone.
def answer(df: pd.DataFrame):
# Use df to answer: What is the name of the author with the most retweeted single tweet?
df.columns = ['id', 'author_id', 'author_name', 'author_handler', 'author_avatar', 'lang', 'type', 'text', 'date', 'mention_ids', 'mention_names', 'retweets', 'favorites', 'links', 'links_first', 'image_links', 'image_links_first', 'rp_user_id', 'rp_user_name', 'location', 'tweet_link', 'search']
# Expected output type: is category, this will be checked.
return
|
20250129013714
|
9 |
What is the language of the most favorited post?
|
050_ING
|
dev
|
category
|
['lang', 'favorites']
|
dev
|
# Instructions: Generate ONLY python code. Do not include explanations.
# you can use pandas and numpy. Use the meta data information from df_schema, df_descprtion.
import pandas as pd
import numpy as np
# Description of dataframe schema.
df_schema = {
"columns": [
{
"name": "id",
"type": "int64"
},
{
"name": "author_id",
"type": "int64"
},
{
"name": "author_name",
"type": "category"
},
{
"name": "author_handler",
"type": "category"
},
{
"name": "author_avatar",
"type": "category"
},
{
"name": "lang",
"type": "category"
},
{
"name": "type",
"type": "category"
},
{
"name": "text",
"type": "object"
},
{
"name": "date",
"type": "datetime64[ns, UTC]"
},
{
"name": "mention_ids",
"type": "object"
},
{
"name": "mention_names",
"type": "object"
},
{
"name": "retweets",
"type": "uint8"
},
{
"name": "favorites",
"type": "uint8"
},
{
"name": "links",
"type": "object"
},
{
"name": "links_first",
"type": "category"
},
{
"name": "image_links",
"type": "object"
},
{
"name": "image_links_first",
"type": "category"
},
{
"name": "rp_user_id",
"type": "float64"
},
{
"name": "rp_user_name",
"type": "category"
},
{
"name": "location",
"type": "category"
},
{
"name": "tweet_link",
"type": "category"
},
{
"name": "search",
"type": "category"
}
]
}
# Description of dataframe columns.
df_descrption = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
# Randome sample of 10 rows from the dataframe.
df_random_sample = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
'''
The question categories are:
- boolean: Valid answers include True/False, Y/N, Yes/No (all case insensitive).
- category: A value from a cell (or a substring of a cell) in the dataset.
- number: A numerical value from a cell in the dataset, which may represent a computed statistic (e.g., average, maximum, minimum).
- list[category]: A list containing a fixed number of categories. The expected format is: "['cat', 'dog']". Pay attention to the wording of the question to determine if uniqueness is required or if repeated values are allowed.
- list[number]: Similar to list[category], but with numbers as its elements.
'''
# TODO: complete the following function in one line, by completing the return statement. It should give the answer to: How many rows are there in this dataframe?
def example(df: pd.DataFrame):
df.columns=["A"]
# Expected output type: is number, this will be checked.
return df.shape[0]
# It should give the answer to: What is the language of the most favorited post?
# The answer should only contain python code, you are not allowed leave any TODO undone.
def answer(df: pd.DataFrame):
# Use df to answer: What is the language of the most favorited post?
df.columns = ['id', 'author_id', 'author_name', 'author_handler', 'author_avatar', 'lang', 'type', 'text', 'date', 'mention_ids', 'mention_names', 'retweets', 'favorites', 'links', 'links_first', 'image_links', 'image_links_first', 'rp_user_id', 'rp_user_name', 'location', 'tweet_link', 'search']
# Expected output type: is category, this will be checked.
return
|
20250129013714
|
10 |
Who is the author of the post with the most words?
|
050_ING
|
dev
|
category
|
['author_name', 'text']
|
dev
|
# Instructions: Generate ONLY python code. Do not include explanations.
# you can use pandas and numpy. Use the meta data information from df_schema, df_descprtion.
import pandas as pd
import numpy as np
# Description of dataframe schema.
df_schema = {
"columns": [
{
"name": "id",
"type": "int64"
},
{
"name": "author_id",
"type": "int64"
},
{
"name": "author_name",
"type": "category"
},
{
"name": "author_handler",
"type": "category"
},
{
"name": "author_avatar",
"type": "category"
},
{
"name": "lang",
"type": "category"
},
{
"name": "type",
"type": "category"
},
{
"name": "text",
"type": "object"
},
{
"name": "date",
"type": "datetime64[ns, UTC]"
},
{
"name": "mention_ids",
"type": "object"
},
{
"name": "mention_names",
"type": "object"
},
{
"name": "retweets",
"type": "uint8"
},
{
"name": "favorites",
"type": "uint8"
},
{
"name": "links",
"type": "object"
},
{
"name": "links_first",
"type": "category"
},
{
"name": "image_links",
"type": "object"
},
{
"name": "image_links_first",
"type": "category"
},
{
"name": "rp_user_id",
"type": "float64"
},
{
"name": "rp_user_name",
"type": "category"
},
{
"name": "location",
"type": "category"
},
{
"name": "tweet_link",
"type": "category"
},
{
"name": "search",
"type": "category"
}
]
}
# Description of dataframe columns.
df_descrption = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
# Randome sample of 10 rows from the dataframe.
df_random_sample = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
'''
The question categories are:
- boolean: Valid answers include True/False, Y/N, Yes/No (all case insensitive).
- category: A value from a cell (or a substring of a cell) in the dataset.
- number: A numerical value from a cell in the dataset, which may represent a computed statistic (e.g., average, maximum, minimum).
- list[category]: A list containing a fixed number of categories. The expected format is: "['cat', 'dog']". Pay attention to the wording of the question to determine if uniqueness is required or if repeated values are allowed.
- list[number]: Similar to list[category], but with numbers as its elements.
'''
# TODO: complete the following function in one line, by completing the return statement. It should give the answer to: How many rows are there in this dataframe?
def example(df: pd.DataFrame):
df.columns=["A"]
# Expected output type: is number, this will be checked.
return df.shape[0]
# It should give the answer to: Who is the author of the post with the most words?
# The answer should only contain python code, you are not allowed leave any TODO undone.
def answer(df: pd.DataFrame):
# Use df to answer: Who is the author of the post with the most words?
df.columns = ['id', 'author_id', 'author_name', 'author_handler', 'author_avatar', 'lang', 'type', 'text', 'date', 'mention_ids', 'mention_names', 'retweets', 'favorites', 'links', 'links_first', 'image_links', 'image_links_first', 'rp_user_id', 'rp_user_name', 'location', 'tweet_link', 'search']
# Expected output type: is category, this will be checked.
return
|
20250129013714
|
11 |
What type of post (original, reply, or other) is the most common in the dataset?
|
050_ING
|
dev
|
category
|
['type']
|
dev
|
# Instructions: Generate ONLY python code. Do not include explanations.
# you can use pandas and numpy. Use the meta data information from df_schema, df_descprtion.
import pandas as pd
import numpy as np
# Description of dataframe schema.
df_schema = {
"columns": [
{
"name": "id",
"type": "int64"
},
{
"name": "author_id",
"type": "int64"
},
{
"name": "author_name",
"type": "category"
},
{
"name": "author_handler",
"type": "category"
},
{
"name": "author_avatar",
"type": "category"
},
{
"name": "lang",
"type": "category"
},
{
"name": "type",
"type": "category"
},
{
"name": "text",
"type": "object"
},
{
"name": "date",
"type": "datetime64[ns, UTC]"
},
{
"name": "mention_ids",
"type": "object"
},
{
"name": "mention_names",
"type": "object"
},
{
"name": "retweets",
"type": "uint8"
},
{
"name": "favorites",
"type": "uint8"
},
{
"name": "links",
"type": "object"
},
{
"name": "links_first",
"type": "category"
},
{
"name": "image_links",
"type": "object"
},
{
"name": "image_links_first",
"type": "category"
},
{
"name": "rp_user_id",
"type": "float64"
},
{
"name": "rp_user_name",
"type": "category"
},
{
"name": "location",
"type": "category"
},
{
"name": "tweet_link",
"type": "category"
},
{
"name": "search",
"type": "category"
}
]
}
# Description of dataframe columns.
df_descrption = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
# Randome sample of 10 rows from the dataframe.
df_random_sample = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
'''
The question categories are:
- boolean: Valid answers include True/False, Y/N, Yes/No (all case insensitive).
- category: A value from a cell (or a substring of a cell) in the dataset.
- number: A numerical value from a cell in the dataset, which may represent a computed statistic (e.g., average, maximum, minimum).
- list[category]: A list containing a fixed number of categories. The expected format is: "['cat', 'dog']". Pay attention to the wording of the question to determine if uniqueness is required or if repeated values are allowed.
- list[number]: Similar to list[category], but with numbers as its elements.
'''
# TODO: complete the following function in one line, by completing the return statement. It should give the answer to: How many rows are there in this dataframe?
def example(df: pd.DataFrame):
df.columns=["A"]
# Expected output type: is number, this will be checked.
return df.shape[0]
# It should give the answer to: What type of post (original, reply, or other) is the most common in the dataset?
# The answer should only contain python code, you are not allowed leave any TODO undone.
def answer(df: pd.DataFrame):
# Use df to answer: What type of post (original, reply, or other) is the most common in the dataset?
df.columns = ['id', 'author_id', 'author_name', 'author_handler', 'author_avatar', 'lang', 'type', 'text', 'date', 'mention_ids', 'mention_names', 'retweets', 'favorites', 'links', 'links_first', 'image_links', 'image_links_first', 'rp_user_id', 'rp_user_name', 'location', 'tweet_link', 'search']
# Expected output type: is category, this will be checked.
return
|
20250129013714
|
12 |
Who are the authors of the top 3 most retweeted posts?
|
050_ING
|
dev
|
list[category]
|
['author_name', 'retweets']
|
dev
|
# Instructions: Generate ONLY python code. Do not include explanations.
# you can use pandas and numpy. Use the meta data information from df_schema, df_descprtion.
import pandas as pd
import numpy as np
# Description of dataframe schema.
df_schema = {
"columns": [
{
"name": "id",
"type": "int64"
},
{
"name": "author_id",
"type": "int64"
},
{
"name": "author_name",
"type": "category"
},
{
"name": "author_handler",
"type": "category"
},
{
"name": "author_avatar",
"type": "category"
},
{
"name": "lang",
"type": "category"
},
{
"name": "type",
"type": "category"
},
{
"name": "text",
"type": "object"
},
{
"name": "date",
"type": "datetime64[ns, UTC]"
},
{
"name": "mention_ids",
"type": "object"
},
{
"name": "mention_names",
"type": "object"
},
{
"name": "retweets",
"type": "uint8"
},
{
"name": "favorites",
"type": "uint8"
},
{
"name": "links",
"type": "object"
},
{
"name": "links_first",
"type": "category"
},
{
"name": "image_links",
"type": "object"
},
{
"name": "image_links_first",
"type": "category"
},
{
"name": "rp_user_id",
"type": "float64"
},
{
"name": "rp_user_name",
"type": "category"
},
{
"name": "location",
"type": "category"
},
{
"name": "tweet_link",
"type": "category"
},
{
"name": "search",
"type": "category"
}
]
}
# Description of dataframe columns.
df_descrption = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
# Randome sample of 10 rows from the dataframe.
df_random_sample = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
'''
The question categories are:
- boolean: Valid answers include True/False, Y/N, Yes/No (all case insensitive).
- category: A value from a cell (or a substring of a cell) in the dataset.
- number: A numerical value from a cell in the dataset, which may represent a computed statistic (e.g., average, maximum, minimum).
- list[category]: A list containing a fixed number of categories. The expected format is: "['cat', 'dog']". Pay attention to the wording of the question to determine if uniqueness is required or if repeated values are allowed.
- list[number]: Similar to list[category], but with numbers as its elements.
'''
# TODO: complete the following function in one line, by completing the return statement. It should give the answer to: How many rows are there in this dataframe?
def example(df: pd.DataFrame):
df.columns=["A"]
# Expected output type: is number, this will be checked.
return df.shape[0]
# It should give the answer to: Who are the authors of the top 3 most retweeted posts?
# The answer should only contain python code, you are not allowed leave any TODO undone.
def answer(df: pd.DataFrame):
# Use df to answer: Who are the authors of the top 3 most retweeted posts?
df.columns = ['id', 'author_id', 'author_name', 'author_handler', 'author_avatar', 'lang', 'type', 'text', 'date', 'mention_ids', 'mention_names', 'retweets', 'favorites', 'links', 'links_first', 'image_links', 'image_links_first', 'rp_user_id', 'rp_user_name', 'location', 'tweet_link', 'search']
# Expected output type: is list[category], this will be checked.
return
|
20250129013714
|
13 |
What are the languages of the 5 least favorited posts?
|
050_ING
|
dev
|
list[category]
|
['lang', 'favorites']
|
dev
|
# Instructions: Generate ONLY python code. Do not include explanations.
# you can use pandas and numpy. Use the meta data information from df_schema, df_descprtion.
import pandas as pd
import numpy as np
# Description of dataframe schema.
df_schema = {
"columns": [
{
"name": "id",
"type": "int64"
},
{
"name": "author_id",
"type": "int64"
},
{
"name": "author_name",
"type": "category"
},
{
"name": "author_handler",
"type": "category"
},
{
"name": "author_avatar",
"type": "category"
},
{
"name": "lang",
"type": "category"
},
{
"name": "type",
"type": "category"
},
{
"name": "text",
"type": "object"
},
{
"name": "date",
"type": "datetime64[ns, UTC]"
},
{
"name": "mention_ids",
"type": "object"
},
{
"name": "mention_names",
"type": "object"
},
{
"name": "retweets",
"type": "uint8"
},
{
"name": "favorites",
"type": "uint8"
},
{
"name": "links",
"type": "object"
},
{
"name": "links_first",
"type": "category"
},
{
"name": "image_links",
"type": "object"
},
{
"name": "image_links_first",
"type": "category"
},
{
"name": "rp_user_id",
"type": "float64"
},
{
"name": "rp_user_name",
"type": "category"
},
{
"name": "location",
"type": "category"
},
{
"name": "tweet_link",
"type": "category"
},
{
"name": "search",
"type": "category"
}
]
}
# Description of dataframe columns.
df_descrption = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
# Randome sample of 10 rows from the dataframe.
df_random_sample = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
'''
The question categories are:
- boolean: Valid answers include True/False, Y/N, Yes/No (all case insensitive).
- category: A value from a cell (or a substring of a cell) in the dataset.
- number: A numerical value from a cell in the dataset, which may represent a computed statistic (e.g., average, maximum, minimum).
- list[category]: A list containing a fixed number of categories. The expected format is: "['cat', 'dog']". Pay attention to the wording of the question to determine if uniqueness is required or if repeated values are allowed.
- list[number]: Similar to list[category], but with numbers as its elements.
'''
# TODO: complete the following function in one line, by completing the return statement. It should give the answer to: How many rows are there in this dataframe?
def example(df: pd.DataFrame):
df.columns=["A"]
# Expected output type: is number, this will be checked.
return df.shape[0]
# It should give the answer to: What are the languages of the 5 least favorited posts?
# The answer should only contain python code, you are not allowed leave any TODO undone.
def answer(df: pd.DataFrame):
# Use df to answer: What are the languages of the 5 least favorited posts?
df.columns = ['id', 'author_id', 'author_name', 'author_handler', 'author_avatar', 'lang', 'type', 'text', 'date', 'mention_ids', 'mention_names', 'retweets', 'favorites', 'links', 'links_first', 'image_links', 'image_links_first', 'rp_user_id', 'rp_user_name', 'location', 'tweet_link', 'search']
# Expected output type: is list[category], this will be checked.
return
|
20250129013714
|
14 |
Who are the authors of the 4 shortest posts (based on the number of words)?
|
050_ING
|
dev
|
list[category]
|
['author_name', 'text']
|
dev
|
# Instructions: Generate ONLY python code. Do not include explanations.
# you can use pandas and numpy. Use the meta data information from df_schema, df_descprtion.
import pandas as pd
import numpy as np
# Description of dataframe schema.
df_schema = {
"columns": [
{
"name": "id",
"type": "int64"
},
{
"name": "author_id",
"type": "int64"
},
{
"name": "author_name",
"type": "category"
},
{
"name": "author_handler",
"type": "category"
},
{
"name": "author_avatar",
"type": "category"
},
{
"name": "lang",
"type": "category"
},
{
"name": "type",
"type": "category"
},
{
"name": "text",
"type": "object"
},
{
"name": "date",
"type": "datetime64[ns, UTC]"
},
{
"name": "mention_ids",
"type": "object"
},
{
"name": "mention_names",
"type": "object"
},
{
"name": "retweets",
"type": "uint8"
},
{
"name": "favorites",
"type": "uint8"
},
{
"name": "links",
"type": "object"
},
{
"name": "links_first",
"type": "category"
},
{
"name": "image_links",
"type": "object"
},
{
"name": "image_links_first",
"type": "category"
},
{
"name": "rp_user_id",
"type": "float64"
},
{
"name": "rp_user_name",
"type": "category"
},
{
"name": "location",
"type": "category"
},
{
"name": "tweet_link",
"type": "category"
},
{
"name": "search",
"type": "category"
}
]
}
# Description of dataframe columns.
df_descrption = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
# Randome sample of 10 rows from the dataframe.
df_random_sample = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
'''
The question categories are:
- boolean: Valid answers include True/False, Y/N, Yes/No (all case insensitive).
- category: A value from a cell (or a substring of a cell) in the dataset.
- number: A numerical value from a cell in the dataset, which may represent a computed statistic (e.g., average, maximum, minimum).
- list[category]: A list containing a fixed number of categories. The expected format is: "['cat', 'dog']". Pay attention to the wording of the question to determine if uniqueness is required or if repeated values are allowed.
- list[number]: Similar to list[category], but with numbers as its elements.
'''
# TODO: complete the following function in one line, by completing the return statement. It should give the answer to: How many rows are there in this dataframe?
def example(df: pd.DataFrame):
df.columns=["A"]
# Expected output type: is number, this will be checked.
return df.shape[0]
# It should give the answer to: Who are the authors of the 4 shortest posts (based on the number of words)?
# The answer should only contain python code, you are not allowed leave any TODO undone.
def answer(df: pd.DataFrame):
# Use df to answer: Who are the authors of the 4 shortest posts (based on the number of words)?
df.columns = ['id', 'author_id', 'author_name', 'author_handler', 'author_avatar', 'lang', 'type', 'text', 'date', 'mention_ids', 'mention_names', 'retweets', 'favorites', 'links', 'links_first', 'image_links', 'image_links_first', 'rp_user_id', 'rp_user_name', 'location', 'tweet_link', 'search']
# Expected output type: is list[category], this will be checked.
return
|
20250129013714
|
15 |
What types of posts are the 6 most common in the dataset?
|
050_ING
|
dev
|
list[category]
|
['type']
|
dev
|
# Instructions: Generate ONLY python code. Do not include explanations.
# you can use pandas and numpy. Use the meta data information from df_schema, df_descprtion.
import pandas as pd
import numpy as np
# Description of dataframe schema.
df_schema = {
"columns": [
{
"name": "id",
"type": "int64"
},
{
"name": "author_id",
"type": "int64"
},
{
"name": "author_name",
"type": "category"
},
{
"name": "author_handler",
"type": "category"
},
{
"name": "author_avatar",
"type": "category"
},
{
"name": "lang",
"type": "category"
},
{
"name": "type",
"type": "category"
},
{
"name": "text",
"type": "object"
},
{
"name": "date",
"type": "datetime64[ns, UTC]"
},
{
"name": "mention_ids",
"type": "object"
},
{
"name": "mention_names",
"type": "object"
},
{
"name": "retweets",
"type": "uint8"
},
{
"name": "favorites",
"type": "uint8"
},
{
"name": "links",
"type": "object"
},
{
"name": "links_first",
"type": "category"
},
{
"name": "image_links",
"type": "object"
},
{
"name": "image_links_first",
"type": "category"
},
{
"name": "rp_user_id",
"type": "float64"
},
{
"name": "rp_user_name",
"type": "category"
},
{
"name": "location",
"type": "category"
},
{
"name": "tweet_link",
"type": "category"
},
{
"name": "search",
"type": "category"
}
]
}
# Description of dataframe columns.
df_descrption = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
# Randome sample of 10 rows from the dataframe.
df_random_sample = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
'''
The question categories are:
- boolean: Valid answers include True/False, Y/N, Yes/No (all case insensitive).
- category: A value from a cell (or a substring of a cell) in the dataset.
- number: A numerical value from a cell in the dataset, which may represent a computed statistic (e.g., average, maximum, minimum).
- list[category]: A list containing a fixed number of categories. The expected format is: "['cat', 'dog']". Pay attention to the wording of the question to determine if uniqueness is required or if repeated values are allowed.
- list[number]: Similar to list[category], but with numbers as its elements.
'''
# TODO: complete the following function in one line, by completing the return statement. It should give the answer to: How many rows are there in this dataframe?
def example(df: pd.DataFrame):
df.columns=["A"]
# Expected output type: is number, this will be checked.
return df.shape[0]
# It should give the answer to: What types of posts are the 6 most common in the dataset?
# The answer should only contain python code, you are not allowed leave any TODO undone.
def answer(df: pd.DataFrame):
# Use df to answer: What types of posts are the 6 most common in the dataset?
df.columns = ['id', 'author_id', 'author_name', 'author_handler', 'author_avatar', 'lang', 'type', 'text', 'date', 'mention_ids', 'mention_names', 'retweets', 'favorites', 'links', 'links_first', 'image_links', 'image_links_first', 'rp_user_id', 'rp_user_name', 'location', 'tweet_link', 'search']
# Expected output type: is list[category], this will be checked.
return
|
20250129013714
|
16 |
What are the retweet counts for the top 5 most favorited posts?
|
050_ING
|
dev
|
list[number]
|
['retweets', 'favorites']
|
dev
|
# Instructions: Generate ONLY python code. Do not include explanations.
# you can use pandas and numpy. Use the meta data information from df_schema, df_descprtion.
import pandas as pd
import numpy as np
# Description of dataframe schema.
df_schema = {
"columns": [
{
"name": "id",
"type": "int64"
},
{
"name": "author_id",
"type": "int64"
},
{
"name": "author_name",
"type": "category"
},
{
"name": "author_handler",
"type": "category"
},
{
"name": "author_avatar",
"type": "category"
},
{
"name": "lang",
"type": "category"
},
{
"name": "type",
"type": "category"
},
{
"name": "text",
"type": "object"
},
{
"name": "date",
"type": "datetime64[ns, UTC]"
},
{
"name": "mention_ids",
"type": "object"
},
{
"name": "mention_names",
"type": "object"
},
{
"name": "retweets",
"type": "uint8"
},
{
"name": "favorites",
"type": "uint8"
},
{
"name": "links",
"type": "object"
},
{
"name": "links_first",
"type": "category"
},
{
"name": "image_links",
"type": "object"
},
{
"name": "image_links_first",
"type": "category"
},
{
"name": "rp_user_id",
"type": "float64"
},
{
"name": "rp_user_name",
"type": "category"
},
{
"name": "location",
"type": "category"
},
{
"name": "tweet_link",
"type": "category"
},
{
"name": "search",
"type": "category"
}
]
}
# Description of dataframe columns.
df_descrption = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
# Randome sample of 10 rows from the dataframe.
df_random_sample = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
'''
The question categories are:
- boolean: Valid answers include True/False, Y/N, Yes/No (all case insensitive).
- category: A value from a cell (or a substring of a cell) in the dataset.
- number: A numerical value from a cell in the dataset, which may represent a computed statistic (e.g., average, maximum, minimum).
- list[category]: A list containing a fixed number of categories. The expected format is: "['cat', 'dog']". Pay attention to the wording of the question to determine if uniqueness is required or if repeated values are allowed.
- list[number]: Similar to list[category], but with numbers as its elements.
'''
# TODO: complete the following function in one line, by completing the return statement. It should give the answer to: How many rows are there in this dataframe?
def example(df: pd.DataFrame):
df.columns=["A"]
# Expected output type: is number, this will be checked.
return df.shape[0]
# It should give the answer to: What are the retweet counts for the top 5 most favorited posts?
# The answer should only contain python code, you are not allowed leave any TODO undone.
def answer(df: pd.DataFrame):
# Use df to answer: What are the retweet counts for the top 5 most favorited posts?
df.columns = ['id', 'author_id', 'author_name', 'author_handler', 'author_avatar', 'lang', 'type', 'text', 'date', 'mention_ids', 'mention_names', 'retweets', 'favorites', 'links', 'links_first', 'image_links', 'image_links_first', 'rp_user_id', 'rp_user_name', 'location', 'tweet_link', 'search']
# Expected output type: is list[number], this will be checked.
return
|
20250129013714
|
17 |
What are the word counts of the 3 longest posts?
|
050_ING
|
dev
|
list[number]
|
['text']
|
dev
|
# Instructions: Generate ONLY python code. Do not include explanations.
# you can use pandas and numpy. Use the meta data information from df_schema, df_descprtion.
import pandas as pd
import numpy as np
# Description of dataframe schema.
df_schema = {
"columns": [
{
"name": "id",
"type": "int64"
},
{
"name": "author_id",
"type": "int64"
},
{
"name": "author_name",
"type": "category"
},
{
"name": "author_handler",
"type": "category"
},
{
"name": "author_avatar",
"type": "category"
},
{
"name": "lang",
"type": "category"
},
{
"name": "type",
"type": "category"
},
{
"name": "text",
"type": "object"
},
{
"name": "date",
"type": "datetime64[ns, UTC]"
},
{
"name": "mention_ids",
"type": "object"
},
{
"name": "mention_names",
"type": "object"
},
{
"name": "retweets",
"type": "uint8"
},
{
"name": "favorites",
"type": "uint8"
},
{
"name": "links",
"type": "object"
},
{
"name": "links_first",
"type": "category"
},
{
"name": "image_links",
"type": "object"
},
{
"name": "image_links_first",
"type": "category"
},
{
"name": "rp_user_id",
"type": "float64"
},
{
"name": "rp_user_name",
"type": "category"
},
{
"name": "location",
"type": "category"
},
{
"name": "tweet_link",
"type": "category"
},
{
"name": "search",
"type": "category"
}
]
}
# Description of dataframe columns.
df_descrption = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
# Randome sample of 10 rows from the dataframe.
df_random_sample = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
'''
The question categories are:
- boolean: Valid answers include True/False, Y/N, Yes/No (all case insensitive).
- category: A value from a cell (or a substring of a cell) in the dataset.
- number: A numerical value from a cell in the dataset, which may represent a computed statistic (e.g., average, maximum, minimum).
- list[category]: A list containing a fixed number of categories. The expected format is: "['cat', 'dog']". Pay attention to the wording of the question to determine if uniqueness is required or if repeated values are allowed.
- list[number]: Similar to list[category], but with numbers as its elements.
'''
# TODO: complete the following function in one line, by completing the return statement. It should give the answer to: How many rows are there in this dataframe?
def example(df: pd.DataFrame):
df.columns=["A"]
# Expected output type: is number, this will be checked.
return df.shape[0]
# It should give the answer to: What are the word counts of the 3 longest posts?
# The answer should only contain python code, you are not allowed leave any TODO undone.
def answer(df: pd.DataFrame):
# Use df to answer: What are the word counts of the 3 longest posts?
df.columns = ['id', 'author_id', 'author_name', 'author_handler', 'author_avatar', 'lang', 'type', 'text', 'date', 'mention_ids', 'mention_names', 'retweets', 'favorites', 'links', 'links_first', 'image_links', 'image_links_first', 'rp_user_id', 'rp_user_name', 'location', 'tweet_link', 'search']
# Expected output type: is list[number], this will be checked.
return
|
20250129013714
|
18 |
What are the retweet counts of the 4 least favorited posts?
|
050_ING
|
dev
|
list[number]
|
['retweets', 'favorites']
|
dev
|
# Instructions: Generate ONLY python code. Do not include explanations.
# you can use pandas and numpy. Use the meta data information from df_schema, df_descprtion.
import pandas as pd
import numpy as np
# Description of dataframe schema.
df_schema = {
"columns": [
{
"name": "id",
"type": "int64"
},
{
"name": "author_id",
"type": "int64"
},
{
"name": "author_name",
"type": "category"
},
{
"name": "author_handler",
"type": "category"
},
{
"name": "author_avatar",
"type": "category"
},
{
"name": "lang",
"type": "category"
},
{
"name": "type",
"type": "category"
},
{
"name": "text",
"type": "object"
},
{
"name": "date",
"type": "datetime64[ns, UTC]"
},
{
"name": "mention_ids",
"type": "object"
},
{
"name": "mention_names",
"type": "object"
},
{
"name": "retweets",
"type": "uint8"
},
{
"name": "favorites",
"type": "uint8"
},
{
"name": "links",
"type": "object"
},
{
"name": "links_first",
"type": "category"
},
{
"name": "image_links",
"type": "object"
},
{
"name": "image_links_first",
"type": "category"
},
{
"name": "rp_user_id",
"type": "float64"
},
{
"name": "rp_user_name",
"type": "category"
},
{
"name": "location",
"type": "category"
},
{
"name": "tweet_link",
"type": "category"
},
{
"name": "search",
"type": "category"
}
]
}
# Description of dataframe columns.
df_descrption = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
# Randome sample of 10 rows from the dataframe.
df_random_sample = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
'''
The question categories are:
- boolean: Valid answers include True/False, Y/N, Yes/No (all case insensitive).
- category: A value from a cell (or a substring of a cell) in the dataset.
- number: A numerical value from a cell in the dataset, which may represent a computed statistic (e.g., average, maximum, minimum).
- list[category]: A list containing a fixed number of categories. The expected format is: "['cat', 'dog']". Pay attention to the wording of the question to determine if uniqueness is required or if repeated values are allowed.
- list[number]: Similar to list[category], but with numbers as its elements.
'''
# TODO: complete the following function in one line, by completing the return statement. It should give the answer to: How many rows are there in this dataframe?
def example(df: pd.DataFrame):
df.columns=["A"]
# Expected output type: is number, this will be checked.
return df.shape[0]
# It should give the answer to: What are the retweet counts of the 4 least favorited posts?
# The answer should only contain python code, you are not allowed leave any TODO undone.
def answer(df: pd.DataFrame):
# Use df to answer: What are the retweet counts of the 4 least favorited posts?
df.columns = ['id', 'author_id', 'author_name', 'author_handler', 'author_avatar', 'lang', 'type', 'text', 'date', 'mention_ids', 'mention_names', 'retweets', 'favorites', 'links', 'links_first', 'image_links', 'image_links_first', 'rp_user_id', 'rp_user_name', 'location', 'tweet_link', 'search']
# Expected output type: is list[number], this will be checked.
return
|
20250129013714
|
19 |
What are the word counts for the 6 shortest posts?
|
050_ING
|
dev
|
list[number]
|
['text']
|
dev
|
# Instructions: Generate ONLY python code. Do not include explanations.
# you can use pandas and numpy. Use the meta data information from df_schema, df_descprtion.
import pandas as pd
import numpy as np
# Description of dataframe schema.
df_schema = {
"columns": [
{
"name": "id",
"type": "int64"
},
{
"name": "author_id",
"type": "int64"
},
{
"name": "author_name",
"type": "category"
},
{
"name": "author_handler",
"type": "category"
},
{
"name": "author_avatar",
"type": "category"
},
{
"name": "lang",
"type": "category"
},
{
"name": "type",
"type": "category"
},
{
"name": "text",
"type": "object"
},
{
"name": "date",
"type": "datetime64[ns, UTC]"
},
{
"name": "mention_ids",
"type": "object"
},
{
"name": "mention_names",
"type": "object"
},
{
"name": "retweets",
"type": "uint8"
},
{
"name": "favorites",
"type": "uint8"
},
{
"name": "links",
"type": "object"
},
{
"name": "links_first",
"type": "category"
},
{
"name": "image_links",
"type": "object"
},
{
"name": "image_links_first",
"type": "category"
},
{
"name": "rp_user_id",
"type": "float64"
},
{
"name": "rp_user_name",
"type": "category"
},
{
"name": "location",
"type": "category"
},
{
"name": "tweet_link",
"type": "category"
},
{
"name": "search",
"type": "category"
}
]
}
# Description of dataframe columns.
df_descrption = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
# Randome sample of 10 rows from the dataframe.
df_random_sample = {
"count":{
"id":7244.0,
"author_id":7244.0,
"retweets":7244.0,
"favorites":7244.0,
"rp_user_id":4094.0
},
"mean":{
"id":1.129999764e+18,
"author_id":1.456169002e+17,
"retweets":0.1715902816,
"favorites":0.6188569851,
"rp_user_id":270815203.0
},
"std":{
"id":2.920544101e+16,
"author_id":3.490773128e+17,
"retweets":0.7395750951,
"favorites":1.8434020668,
"rp_user_id":0.0
},
"min":{
"id":1.079908205e+18,
"author_id":7007.0,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"25%":{
"id":1.10505894e+18,
"author_id":140041809.75,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"50%":{
"id":1.124196559e+18,
"author_id":318183125.5,
"retweets":0.0,
"favorites":0.0,
"rp_user_id":270815203.0
},
"75%":{
"id":1.158378457e+18,
"author_id":1901654083.0,
"retweets":0.0,
"favorites":1.0,
"rp_user_id":270815203.0
},
"max":{
"id":1.176868218e+18,
"author_id":1.175435395e+18,
"retweets":17.0,
"favorites":41.0,
"rp_user_id":270815203.0
}
}
'''
The question categories are:
- boolean: Valid answers include True/False, Y/N, Yes/No (all case insensitive).
- category: A value from a cell (or a substring of a cell) in the dataset.
- number: A numerical value from a cell in the dataset, which may represent a computed statistic (e.g., average, maximum, minimum).
- list[category]: A list containing a fixed number of categories. The expected format is: "['cat', 'dog']". Pay attention to the wording of the question to determine if uniqueness is required or if repeated values are allowed.
- list[number]: Similar to list[category], but with numbers as its elements.
'''
# TODO: complete the following function in one line, by completing the return statement. It should give the answer to: How many rows are there in this dataframe?
def example(df: pd.DataFrame):
df.columns=["A"]
# Expected output type: is number, this will be checked.
return df.shape[0]
# It should give the answer to: What are the word counts for the 6 shortest posts?
# The answer should only contain python code, you are not allowed leave any TODO undone.
def answer(df: pd.DataFrame):
# Use df to answer: What are the word counts for the 6 shortest posts?
df.columns = ['id', 'author_id', 'author_name', 'author_handler', 'author_avatar', 'lang', 'type', 'text', 'date', 'mention_ids', 'mention_names', 'retweets', 'favorites', 'links', 'links_first', 'image_links', 'image_links_first', 'rp_user_id', 'rp_user_name', 'location', 'tweet_link', 'search']
# Expected output type: is list[number], this will be checked.
return
|
20250129013714
|
20 |
Is there a Pokémon named 'Pikachu' in the dataset?
|
051_Pokemon
|
dev
|
boolean
|
['name']
|
dev
|
# Instructions: Generate ONLY python code. Do not include explanations.
# you can use pandas and numpy. Use the meta data information from df_schema, df_descprtion.
import pandas as pd
import numpy as np
# Description of dataframe schema.
df_schema = {
"columns": [
{
"name": "number",
"type": "uint16"
},
{
"name": "name",
"type": "category"
},
{
"name": "type1",
"type": "category"
},
{
"name": "type2",
"type": "category"
},
{
"name": "total",
"type": "uint16"
},
{
"name": "hp",
"type": "uint8"
},
{
"name": "attack",
"type": "uint8"
},
{
"name": "defense",
"type": "uint8"
},
{
"name": "sp_attack",
"type": "uint8"
},
{
"name": "sp_defense",
"type": "uint8"
},
{
"name": "speed",
"type": "uint8"
},
{
"name": "generation",
"type": "uint8"
},
{
"name": "legendary",
"type": "bool"
}
]
}
# Description of dataframe columns.
df_descrption = {
"count":{
"number":1072.0,
"total":1072.0,
"hp":1072.0,
"attack":1072.0,
"defense":1072.0,
"sp_attack":1072.0,
"sp_defense":1072.0,
"speed":1072.0,
"generation":1072.0
},
"mean":{
"number":445.2192164179,
"total":440.885261194,
"hp":70.4869402985,
"attack":80.9384328358,
"defense":74.9682835821,
"sp_attack":73.2733208955,
"sp_defense":72.4766791045,
"speed":68.7929104478,
"generation":4.2947761194
},
"std":{
"number":267.77280649,
"total":121.3790771926,
"hp":26.8680389923,
"attack":32.4635820748,
"defense":31.2080593873,
"sp_attack":32.6431190064,
"sp_defense":27.9342534926,
"speed":30.0762806451,
"generation":2.3464717631
},
"min":{
"number":1.0,
"total":175.0,
"hp":1.0,
"attack":5.0,
"defense":5.0,
"sp_attack":10.0,
"sp_defense":20.0,
"speed":5.0,
"generation":0.0
},
"25%":{
"number":209.75,
"total":330.0,
"hp":50.0,
"attack":56.0,
"defense":52.0,
"sp_attack":50.0,
"sp_defense":50.0,
"speed":45.0,
"generation":2.0
},
"50%":{
"number":442.5,
"total":460.5,
"hp":68.0,
"attack":80.0,
"defense":70.0,
"sp_attack":65.0,
"sp_defense":70.0,
"speed":65.0,
"generation":4.0
},
"75%":{
"number":681.25,
"total":519.25,
"hp":84.0,
"attack":100.0,
"defense":90.0,
"sp_attack":95.0,
"sp_defense":90.0,
"speed":90.0,
"generation":6.0
},
"max":{
"number":898.0,
"total":1125.0,
"hp":255.0,
"attack":190.0,
"defense":250.0,
"sp_attack":194.0,
"sp_defense":250.0,
"speed":200.0,
"generation":8.0
}
}
# Randome sample of 10 rows from the dataframe.
df_random_sample = {
"count":{
"number":1072.0,
"total":1072.0,
"hp":1072.0,
"attack":1072.0,
"defense":1072.0,
"sp_attack":1072.0,
"sp_defense":1072.0,
"speed":1072.0,
"generation":1072.0
},
"mean":{
"number":445.2192164179,
"total":440.885261194,
"hp":70.4869402985,
"attack":80.9384328358,
"defense":74.9682835821,
"sp_attack":73.2733208955,
"sp_defense":72.4766791045,
"speed":68.7929104478,
"generation":4.2947761194
},
"std":{
"number":267.77280649,
"total":121.3790771926,
"hp":26.8680389923,
"attack":32.4635820748,
"defense":31.2080593873,
"sp_attack":32.6431190064,
"sp_defense":27.9342534926,
"speed":30.0762806451,
"generation":2.3464717631
},
"min":{
"number":1.0,
"total":175.0,
"hp":1.0,
"attack":5.0,
"defense":5.0,
"sp_attack":10.0,
"sp_defense":20.0,
"speed":5.0,
"generation":0.0
},
"25%":{
"number":209.75,
"total":330.0,
"hp":50.0,
"attack":56.0,
"defense":52.0,
"sp_attack":50.0,
"sp_defense":50.0,
"speed":45.0,
"generation":2.0
},
"50%":{
"number":442.5,
"total":460.5,
"hp":68.0,
"attack":80.0,
"defense":70.0,
"sp_attack":65.0,
"sp_defense":70.0,
"speed":65.0,
"generation":4.0
},
"75%":{
"number":681.25,
"total":519.25,
"hp":84.0,
"attack":100.0,
"defense":90.0,
"sp_attack":95.0,
"sp_defense":90.0,
"speed":90.0,
"generation":6.0
},
"max":{
"number":898.0,
"total":1125.0,
"hp":255.0,
"attack":190.0,
"defense":250.0,
"sp_attack":194.0,
"sp_defense":250.0,
"speed":200.0,
"generation":8.0
}
}
'''
The question categories are:
- boolean: Valid answers include True/False, Y/N, Yes/No (all case insensitive).
- category: A value from a cell (or a substring of a cell) in the dataset.
- number: A numerical value from a cell in the dataset, which may represent a computed statistic (e.g., average, maximum, minimum).
- list[category]: A list containing a fixed number of categories. The expected format is: "['cat', 'dog']". Pay attention to the wording of the question to determine if uniqueness is required or if repeated values are allowed.
- list[number]: Similar to list[category], but with numbers as its elements.
'''
# TODO: complete the following function in one line, by completing the return statement. It should give the answer to: How many rows are there in this dataframe?
def example(df: pd.DataFrame):
df.columns=["A"]
# Expected output type: is number, this will be checked.
return df.shape[0]
# It should give the answer to: Is there a Pokémon named 'Pikachu' in the dataset?
# The answer should only contain python code, you are not allowed leave any TODO undone.
def answer(df: pd.DataFrame):
# Use df to answer: Is there a Pokémon named 'Pikachu' in the dataset?
df.columns = ['number', 'name', 'type1', 'type2', 'total', 'hp', 'attack', 'defense', 'sp_attack', 'sp_defense', 'speed', 'generation', 'legendary']
# Expected output type: is boolean, this will be checked.
return
|
20250129013714
|
21 |
Are there any Pokémon with a total stat greater than 700?
|
051_Pokemon
|
dev
|
boolean
|
['total']
|
dev
|
# Instructions: Generate ONLY python code. Do not include explanations.
# you can use pandas and numpy. Use the meta data information from df_schema, df_descprtion.
import pandas as pd
import numpy as np
# Description of dataframe schema.
df_schema = {
"columns": [
{
"name": "number",
"type": "uint16"
},
{
"name": "name",
"type": "category"
},
{
"name": "type1",
"type": "category"
},
{
"name": "type2",
"type": "category"
},
{
"name": "total",
"type": "uint16"
},
{
"name": "hp",
"type": "uint8"
},
{
"name": "attack",
"type": "uint8"
},
{
"name": "defense",
"type": "uint8"
},
{
"name": "sp_attack",
"type": "uint8"
},
{
"name": "sp_defense",
"type": "uint8"
},
{
"name": "speed",
"type": "uint8"
},
{
"name": "generation",
"type": "uint8"
},
{
"name": "legendary",
"type": "bool"
}
]
}
# Description of dataframe columns.
df_descrption = {
"count":{
"number":1072.0,
"total":1072.0,
"hp":1072.0,
"attack":1072.0,
"defense":1072.0,
"sp_attack":1072.0,
"sp_defense":1072.0,
"speed":1072.0,
"generation":1072.0
},
"mean":{
"number":445.2192164179,
"total":440.885261194,
"hp":70.4869402985,
"attack":80.9384328358,
"defense":74.9682835821,
"sp_attack":73.2733208955,
"sp_defense":72.4766791045,
"speed":68.7929104478,
"generation":4.2947761194
},
"std":{
"number":267.77280649,
"total":121.3790771926,
"hp":26.8680389923,
"attack":32.4635820748,
"defense":31.2080593873,
"sp_attack":32.6431190064,
"sp_defense":27.9342534926,
"speed":30.0762806451,
"generation":2.3464717631
},
"min":{
"number":1.0,
"total":175.0,
"hp":1.0,
"attack":5.0,
"defense":5.0,
"sp_attack":10.0,
"sp_defense":20.0,
"speed":5.0,
"generation":0.0
},
"25%":{
"number":209.75,
"total":330.0,
"hp":50.0,
"attack":56.0,
"defense":52.0,
"sp_attack":50.0,
"sp_defense":50.0,
"speed":45.0,
"generation":2.0
},
"50%":{
"number":442.5,
"total":460.5,
"hp":68.0,
"attack":80.0,
"defense":70.0,
"sp_attack":65.0,
"sp_defense":70.0,
"speed":65.0,
"generation":4.0
},
"75%":{
"number":681.25,
"total":519.25,
"hp":84.0,
"attack":100.0,
"defense":90.0,
"sp_attack":95.0,
"sp_defense":90.0,
"speed":90.0,
"generation":6.0
},
"max":{
"number":898.0,
"total":1125.0,
"hp":255.0,
"attack":190.0,
"defense":250.0,
"sp_attack":194.0,
"sp_defense":250.0,
"speed":200.0,
"generation":8.0
}
}
# Randome sample of 10 rows from the dataframe.
df_random_sample = {
"count":{
"number":1072.0,
"total":1072.0,
"hp":1072.0,
"attack":1072.0,
"defense":1072.0,
"sp_attack":1072.0,
"sp_defense":1072.0,
"speed":1072.0,
"generation":1072.0
},
"mean":{
"number":445.2192164179,
"total":440.885261194,
"hp":70.4869402985,
"attack":80.9384328358,
"defense":74.9682835821,
"sp_attack":73.2733208955,
"sp_defense":72.4766791045,
"speed":68.7929104478,
"generation":4.2947761194
},
"std":{
"number":267.77280649,
"total":121.3790771926,
"hp":26.8680389923,
"attack":32.4635820748,
"defense":31.2080593873,
"sp_attack":32.6431190064,
"sp_defense":27.9342534926,
"speed":30.0762806451,
"generation":2.3464717631
},
"min":{
"number":1.0,
"total":175.0,
"hp":1.0,
"attack":5.0,
"defense":5.0,
"sp_attack":10.0,
"sp_defense":20.0,
"speed":5.0,
"generation":0.0
},
"25%":{
"number":209.75,
"total":330.0,
"hp":50.0,
"attack":56.0,
"defense":52.0,
"sp_attack":50.0,
"sp_defense":50.0,
"speed":45.0,
"generation":2.0
},
"50%":{
"number":442.5,
"total":460.5,
"hp":68.0,
"attack":80.0,
"defense":70.0,
"sp_attack":65.0,
"sp_defense":70.0,
"speed":65.0,
"generation":4.0
},
"75%":{
"number":681.25,
"total":519.25,
"hp":84.0,
"attack":100.0,
"defense":90.0,
"sp_attack":95.0,
"sp_defense":90.0,
"speed":90.0,
"generation":6.0
},
"max":{
"number":898.0,
"total":1125.0,
"hp":255.0,
"attack":190.0,
"defense":250.0,
"sp_attack":194.0,
"sp_defense":250.0,
"speed":200.0,
"generation":8.0
}
}
'''
The question categories are:
- boolean: Valid answers include True/False, Y/N, Yes/No (all case insensitive).
- category: A value from a cell (or a substring of a cell) in the dataset.
- number: A numerical value from a cell in the dataset, which may represent a computed statistic (e.g., average, maximum, minimum).
- list[category]: A list containing a fixed number of categories. The expected format is: "['cat', 'dog']". Pay attention to the wording of the question to determine if uniqueness is required or if repeated values are allowed.
- list[number]: Similar to list[category], but with numbers as its elements.
'''
# TODO: complete the following function in one line, by completing the return statement. It should give the answer to: How many rows are there in this dataframe?
def example(df: pd.DataFrame):
df.columns=["A"]
# Expected output type: is number, this will be checked.
return df.shape[0]
# It should give the answer to: Are there any Pokémon with a total stat greater than 700?
# The answer should only contain python code, you are not allowed leave any TODO undone.
def answer(df: pd.DataFrame):
# Use df to answer: Are there any Pokémon with a total stat greater than 700?
df.columns = ['number', 'name', 'type1', 'type2', 'total', 'hp', 'attack', 'defense', 'sp_attack', 'sp_defense', 'speed', 'generation', 'legendary']
# Expected output type: is boolean, this will be checked.
return
|
20250129013714
|
22 |
Are all Pokémon in the first generation legendary?
|
051_Pokemon
|
dev
|
boolean
|
['generation', 'legendary']
|
dev
|
# Instructions: Generate ONLY python code. Do not include explanations.
# you can use pandas and numpy. Use the meta data information from df_schema, df_descprtion.
import pandas as pd
import numpy as np
# Description of dataframe schema.
df_schema = {
"columns": [
{
"name": "number",
"type": "uint16"
},
{
"name": "name",
"type": "category"
},
{
"name": "type1",
"type": "category"
},
{
"name": "type2",
"type": "category"
},
{
"name": "total",
"type": "uint16"
},
{
"name": "hp",
"type": "uint8"
},
{
"name": "attack",
"type": "uint8"
},
{
"name": "defense",
"type": "uint8"
},
{
"name": "sp_attack",
"type": "uint8"
},
{
"name": "sp_defense",
"type": "uint8"
},
{
"name": "speed",
"type": "uint8"
},
{
"name": "generation",
"type": "uint8"
},
{
"name": "legendary",
"type": "bool"
}
]
}
# Description of dataframe columns.
df_descrption = {
"count":{
"number":1072.0,
"total":1072.0,
"hp":1072.0,
"attack":1072.0,
"defense":1072.0,
"sp_attack":1072.0,
"sp_defense":1072.0,
"speed":1072.0,
"generation":1072.0
},
"mean":{
"number":445.2192164179,
"total":440.885261194,
"hp":70.4869402985,
"attack":80.9384328358,
"defense":74.9682835821,
"sp_attack":73.2733208955,
"sp_defense":72.4766791045,
"speed":68.7929104478,
"generation":4.2947761194
},
"std":{
"number":267.77280649,
"total":121.3790771926,
"hp":26.8680389923,
"attack":32.4635820748,
"defense":31.2080593873,
"sp_attack":32.6431190064,
"sp_defense":27.9342534926,
"speed":30.0762806451,
"generation":2.3464717631
},
"min":{
"number":1.0,
"total":175.0,
"hp":1.0,
"attack":5.0,
"defense":5.0,
"sp_attack":10.0,
"sp_defense":20.0,
"speed":5.0,
"generation":0.0
},
"25%":{
"number":209.75,
"total":330.0,
"hp":50.0,
"attack":56.0,
"defense":52.0,
"sp_attack":50.0,
"sp_defense":50.0,
"speed":45.0,
"generation":2.0
},
"50%":{
"number":442.5,
"total":460.5,
"hp":68.0,
"attack":80.0,
"defense":70.0,
"sp_attack":65.0,
"sp_defense":70.0,
"speed":65.0,
"generation":4.0
},
"75%":{
"number":681.25,
"total":519.25,
"hp":84.0,
"attack":100.0,
"defense":90.0,
"sp_attack":95.0,
"sp_defense":90.0,
"speed":90.0,
"generation":6.0
},
"max":{
"number":898.0,
"total":1125.0,
"hp":255.0,
"attack":190.0,
"defense":250.0,
"sp_attack":194.0,
"sp_defense":250.0,
"speed":200.0,
"generation":8.0
}
}
# Randome sample of 10 rows from the dataframe.
df_random_sample = {
"count":{
"number":1072.0,
"total":1072.0,
"hp":1072.0,
"attack":1072.0,
"defense":1072.0,
"sp_attack":1072.0,
"sp_defense":1072.0,
"speed":1072.0,
"generation":1072.0
},
"mean":{
"number":445.2192164179,
"total":440.885261194,
"hp":70.4869402985,
"attack":80.9384328358,
"defense":74.9682835821,
"sp_attack":73.2733208955,
"sp_defense":72.4766791045,
"speed":68.7929104478,
"generation":4.2947761194
},
"std":{
"number":267.77280649,
"total":121.3790771926,
"hp":26.8680389923,
"attack":32.4635820748,
"defense":31.2080593873,
"sp_attack":32.6431190064,
"sp_defense":27.9342534926,
"speed":30.0762806451,
"generation":2.3464717631
},
"min":{
"number":1.0,
"total":175.0,
"hp":1.0,
"attack":5.0,
"defense":5.0,
"sp_attack":10.0,
"sp_defense":20.0,
"speed":5.0,
"generation":0.0
},
"25%":{
"number":209.75,
"total":330.0,
"hp":50.0,
"attack":56.0,
"defense":52.0,
"sp_attack":50.0,
"sp_defense":50.0,
"speed":45.0,
"generation":2.0
},
"50%":{
"number":442.5,
"total":460.5,
"hp":68.0,
"attack":80.0,
"defense":70.0,
"sp_attack":65.0,
"sp_defense":70.0,
"speed":65.0,
"generation":4.0
},
"75%":{
"number":681.25,
"total":519.25,
"hp":84.0,
"attack":100.0,
"defense":90.0,
"sp_attack":95.0,
"sp_defense":90.0,
"speed":90.0,
"generation":6.0
},
"max":{
"number":898.0,
"total":1125.0,
"hp":255.0,
"attack":190.0,
"defense":250.0,
"sp_attack":194.0,
"sp_defense":250.0,
"speed":200.0,
"generation":8.0
}
}
'''
The question categories are:
- boolean: Valid answers include True/False, Y/N, Yes/No (all case insensitive).
- category: A value from a cell (or a substring of a cell) in the dataset.
- number: A numerical value from a cell in the dataset, which may represent a computed statistic (e.g., average, maximum, minimum).
- list[category]: A list containing a fixed number of categories. The expected format is: "['cat', 'dog']". Pay attention to the wording of the question to determine if uniqueness is required or if repeated values are allowed.
- list[number]: Similar to list[category], but with numbers as its elements.
'''
# TODO: complete the following function in one line, by completing the return statement. It should give the answer to: How many rows are there in this dataframe?
def example(df: pd.DataFrame):
df.columns=["A"]
# Expected output type: is number, this will be checked.
return df.shape[0]
# It should give the answer to: Are all Pokémon in the first generation legendary?
# The answer should only contain python code, you are not allowed leave any TODO undone.
def answer(df: pd.DataFrame):
# Use df to answer: Are all Pokémon in the first generation legendary?
df.columns = ['number', 'name', 'type1', 'type2', 'total', 'hp', 'attack', 'defense', 'sp_attack', 'sp_defense', 'speed', 'generation', 'legendary']
# Expected output type: is boolean, this will be checked.
return
|
20250129013715
|
23 |
Is there any Pokémon with a speed greater than 150?
|
051_Pokemon
|
dev
|
boolean
|
['speed']
|
dev
|
# Instructions: Generate ONLY python code. Do not include explanations.
# you can use pandas and numpy. Use the meta data information from df_schema, df_descprtion.
import pandas as pd
import numpy as np
# Description of dataframe schema.
df_schema = {
"columns": [
{
"name": "number",
"type": "uint16"
},
{
"name": "name",
"type": "category"
},
{
"name": "type1",
"type": "category"
},
{
"name": "type2",
"type": "category"
},
{
"name": "total",
"type": "uint16"
},
{
"name": "hp",
"type": "uint8"
},
{
"name": "attack",
"type": "uint8"
},
{
"name": "defense",
"type": "uint8"
},
{
"name": "sp_attack",
"type": "uint8"
},
{
"name": "sp_defense",
"type": "uint8"
},
{
"name": "speed",
"type": "uint8"
},
{
"name": "generation",
"type": "uint8"
},
{
"name": "legendary",
"type": "bool"
}
]
}
# Description of dataframe columns.
df_descrption = {
"count":{
"number":1072.0,
"total":1072.0,
"hp":1072.0,
"attack":1072.0,
"defense":1072.0,
"sp_attack":1072.0,
"sp_defense":1072.0,
"speed":1072.0,
"generation":1072.0
},
"mean":{
"number":445.2192164179,
"total":440.885261194,
"hp":70.4869402985,
"attack":80.9384328358,
"defense":74.9682835821,
"sp_attack":73.2733208955,
"sp_defense":72.4766791045,
"speed":68.7929104478,
"generation":4.2947761194
},
"std":{
"number":267.77280649,
"total":121.3790771926,
"hp":26.8680389923,
"attack":32.4635820748,
"defense":31.2080593873,
"sp_attack":32.6431190064,
"sp_defense":27.9342534926,
"speed":30.0762806451,
"generation":2.3464717631
},
"min":{
"number":1.0,
"total":175.0,
"hp":1.0,
"attack":5.0,
"defense":5.0,
"sp_attack":10.0,
"sp_defense":20.0,
"speed":5.0,
"generation":0.0
},
"25%":{
"number":209.75,
"total":330.0,
"hp":50.0,
"attack":56.0,
"defense":52.0,
"sp_attack":50.0,
"sp_defense":50.0,
"speed":45.0,
"generation":2.0
},
"50%":{
"number":442.5,
"total":460.5,
"hp":68.0,
"attack":80.0,
"defense":70.0,
"sp_attack":65.0,
"sp_defense":70.0,
"speed":65.0,
"generation":4.0
},
"75%":{
"number":681.25,
"total":519.25,
"hp":84.0,
"attack":100.0,
"defense":90.0,
"sp_attack":95.0,
"sp_defense":90.0,
"speed":90.0,
"generation":6.0
},
"max":{
"number":898.0,
"total":1125.0,
"hp":255.0,
"attack":190.0,
"defense":250.0,
"sp_attack":194.0,
"sp_defense":250.0,
"speed":200.0,
"generation":8.0
}
}
# Randome sample of 10 rows from the dataframe.
df_random_sample = {
"count":{
"number":1072.0,
"total":1072.0,
"hp":1072.0,
"attack":1072.0,
"defense":1072.0,
"sp_attack":1072.0,
"sp_defense":1072.0,
"speed":1072.0,
"generation":1072.0
},
"mean":{
"number":445.2192164179,
"total":440.885261194,
"hp":70.4869402985,
"attack":80.9384328358,
"defense":74.9682835821,
"sp_attack":73.2733208955,
"sp_defense":72.4766791045,
"speed":68.7929104478,
"generation":4.2947761194
},
"std":{
"number":267.77280649,
"total":121.3790771926,
"hp":26.8680389923,
"attack":32.4635820748,
"defense":31.2080593873,
"sp_attack":32.6431190064,
"sp_defense":27.9342534926,
"speed":30.0762806451,
"generation":2.3464717631
},
"min":{
"number":1.0,
"total":175.0,
"hp":1.0,
"attack":5.0,
"defense":5.0,
"sp_attack":10.0,
"sp_defense":20.0,
"speed":5.0,
"generation":0.0
},
"25%":{
"number":209.75,
"total":330.0,
"hp":50.0,
"attack":56.0,
"defense":52.0,
"sp_attack":50.0,
"sp_defense":50.0,
"speed":45.0,
"generation":2.0
},
"50%":{
"number":442.5,
"total":460.5,
"hp":68.0,
"attack":80.0,
"defense":70.0,
"sp_attack":65.0,
"sp_defense":70.0,
"speed":65.0,
"generation":4.0
},
"75%":{
"number":681.25,
"total":519.25,
"hp":84.0,
"attack":100.0,
"defense":90.0,
"sp_attack":95.0,
"sp_defense":90.0,
"speed":90.0,
"generation":6.0
},
"max":{
"number":898.0,
"total":1125.0,
"hp":255.0,
"attack":190.0,
"defense":250.0,
"sp_attack":194.0,
"sp_defense":250.0,
"speed":200.0,
"generation":8.0
}
}
'''
The question categories are:
- boolean: Valid answers include True/False, Y/N, Yes/No (all case insensitive).
- category: A value from a cell (or a substring of a cell) in the dataset.
- number: A numerical value from a cell in the dataset, which may represent a computed statistic (e.g., average, maximum, minimum).
- list[category]: A list containing a fixed number of categories. The expected format is: "['cat', 'dog']". Pay attention to the wording of the question to determine if uniqueness is required or if repeated values are allowed.
- list[number]: Similar to list[category], but with numbers as its elements.
'''
# TODO: complete the following function in one line, by completing the return statement. It should give the answer to: How many rows are there in this dataframe?
def example(df: pd.DataFrame):
df.columns=["A"]
# Expected output type: is number, this will be checked.
return df.shape[0]
# It should give the answer to: Is there any Pokémon with a speed greater than 150?
# The answer should only contain python code, you are not allowed leave any TODO undone.
def answer(df: pd.DataFrame):
# Use df to answer: Is there any Pokémon with a speed greater than 150?
df.columns = ['number', 'name', 'type1', 'type2', 'total', 'hp', 'attack', 'defense', 'sp_attack', 'sp_defense', 'speed', 'generation', 'legendary']
# Expected output type: is boolean, this will be checked.
return
|
20250129013715
|
24 |
How many unique Pokémon types are there in the 'type1' column?
|
051_Pokemon
|
dev
|
number
|
['type1']
|
dev
|
# Instructions: Generate ONLY python code. Do not include explanations.
# you can use pandas and numpy. Use the meta data information from df_schema, df_descprtion.
import pandas as pd
import numpy as np
# Description of dataframe schema.
df_schema = {
"columns": [
{
"name": "number",
"type": "uint16"
},
{
"name": "name",
"type": "category"
},
{
"name": "type1",
"type": "category"
},
{
"name": "type2",
"type": "category"
},
{
"name": "total",
"type": "uint16"
},
{
"name": "hp",
"type": "uint8"
},
{
"name": "attack",
"type": "uint8"
},
{
"name": "defense",
"type": "uint8"
},
{
"name": "sp_attack",
"type": "uint8"
},
{
"name": "sp_defense",
"type": "uint8"
},
{
"name": "speed",
"type": "uint8"
},
{
"name": "generation",
"type": "uint8"
},
{
"name": "legendary",
"type": "bool"
}
]
}
# Description of dataframe columns.
df_descrption = {
"count":{
"number":1072.0,
"total":1072.0,
"hp":1072.0,
"attack":1072.0,
"defense":1072.0,
"sp_attack":1072.0,
"sp_defense":1072.0,
"speed":1072.0,
"generation":1072.0
},
"mean":{
"number":445.2192164179,
"total":440.885261194,
"hp":70.4869402985,
"attack":80.9384328358,
"defense":74.9682835821,
"sp_attack":73.2733208955,
"sp_defense":72.4766791045,
"speed":68.7929104478,
"generation":4.2947761194
},
"std":{
"number":267.77280649,
"total":121.3790771926,
"hp":26.8680389923,
"attack":32.4635820748,
"defense":31.2080593873,
"sp_attack":32.6431190064,
"sp_defense":27.9342534926,
"speed":30.0762806451,
"generation":2.3464717631
},
"min":{
"number":1.0,
"total":175.0,
"hp":1.0,
"attack":5.0,
"defense":5.0,
"sp_attack":10.0,
"sp_defense":20.0,
"speed":5.0,
"generation":0.0
},
"25%":{
"number":209.75,
"total":330.0,
"hp":50.0,
"attack":56.0,
"defense":52.0,
"sp_attack":50.0,
"sp_defense":50.0,
"speed":45.0,
"generation":2.0
},
"50%":{
"number":442.5,
"total":460.5,
"hp":68.0,
"attack":80.0,
"defense":70.0,
"sp_attack":65.0,
"sp_defense":70.0,
"speed":65.0,
"generation":4.0
},
"75%":{
"number":681.25,
"total":519.25,
"hp":84.0,
"attack":100.0,
"defense":90.0,
"sp_attack":95.0,
"sp_defense":90.0,
"speed":90.0,
"generation":6.0
},
"max":{
"number":898.0,
"total":1125.0,
"hp":255.0,
"attack":190.0,
"defense":250.0,
"sp_attack":194.0,
"sp_defense":250.0,
"speed":200.0,
"generation":8.0
}
}
# Randome sample of 10 rows from the dataframe.
df_random_sample = {
"count":{
"number":1072.0,
"total":1072.0,
"hp":1072.0,
"attack":1072.0,
"defense":1072.0,
"sp_attack":1072.0,
"sp_defense":1072.0,
"speed":1072.0,
"generation":1072.0
},
"mean":{
"number":445.2192164179,
"total":440.885261194,
"hp":70.4869402985,
"attack":80.9384328358,
"defense":74.9682835821,
"sp_attack":73.2733208955,
"sp_defense":72.4766791045,
"speed":68.7929104478,
"generation":4.2947761194
},
"std":{
"number":267.77280649,
"total":121.3790771926,
"hp":26.8680389923,
"attack":32.4635820748,
"defense":31.2080593873,
"sp_attack":32.6431190064,
"sp_defense":27.9342534926,
"speed":30.0762806451,
"generation":2.3464717631
},
"min":{
"number":1.0,
"total":175.0,
"hp":1.0,
"attack":5.0,
"defense":5.0,
"sp_attack":10.0,
"sp_defense":20.0,
"speed":5.0,
"generation":0.0
},
"25%":{
"number":209.75,
"total":330.0,
"hp":50.0,
"attack":56.0,
"defense":52.0,
"sp_attack":50.0,
"sp_defense":50.0,
"speed":45.0,
"generation":2.0
},
"50%":{
"number":442.5,
"total":460.5,
"hp":68.0,
"attack":80.0,
"defense":70.0,
"sp_attack":65.0,
"sp_defense":70.0,
"speed":65.0,
"generation":4.0
},
"75%":{
"number":681.25,
"total":519.25,
"hp":84.0,
"attack":100.0,
"defense":90.0,
"sp_attack":95.0,
"sp_defense":90.0,
"speed":90.0,
"generation":6.0
},
"max":{
"number":898.0,
"total":1125.0,
"hp":255.0,
"attack":190.0,
"defense":250.0,
"sp_attack":194.0,
"sp_defense":250.0,
"speed":200.0,
"generation":8.0
}
}
'''
The question categories are:
- boolean: Valid answers include True/False, Y/N, Yes/No (all case insensitive).
- category: A value from a cell (or a substring of a cell) in the dataset.
- number: A numerical value from a cell in the dataset, which may represent a computed statistic (e.g., average, maximum, minimum).
- list[category]: A list containing a fixed number of categories. The expected format is: "['cat', 'dog']". Pay attention to the wording of the question to determine if uniqueness is required or if repeated values are allowed.
- list[number]: Similar to list[category], but with numbers as its elements.
'''
# TODO: complete the following function in one line, by completing the return statement. It should give the answer to: How many rows are there in this dataframe?
def example(df: pd.DataFrame):
df.columns=["A"]
# Expected output type: is number, this will be checked.
return df.shape[0]
# It should give the answer to: How many unique Pokémon types are there in the 'type1' column?
# The answer should only contain python code, you are not allowed leave any TODO undone.
def answer(df: pd.DataFrame):
# Use df to answer: How many unique Pokémon types are there in the 'type1' column?
df.columns = ['number', 'name', 'type1', 'type2', 'total', 'hp', 'attack', 'defense', 'sp_attack', 'sp_defense', 'speed', 'generation', 'legendary']
# Expected output type: is number, this will be checked.
return
|
20250129013715
|
25 |
What's the highest total stat value found in the dataset?
|
051_Pokemon
|
dev
|
number
|
['total']
|
dev
|
# Instructions: Generate ONLY python code. Do not include explanations.
# you can use pandas and numpy. Use the meta data information from df_schema, df_descprtion.
import pandas as pd
import numpy as np
# Description of dataframe schema.
df_schema = {
"columns": [
{
"name": "number",
"type": "uint16"
},
{
"name": "name",
"type": "category"
},
{
"name": "type1",
"type": "category"
},
{
"name": "type2",
"type": "category"
},
{
"name": "total",
"type": "uint16"
},
{
"name": "hp",
"type": "uint8"
},
{
"name": "attack",
"type": "uint8"
},
{
"name": "defense",
"type": "uint8"
},
{
"name": "sp_attack",
"type": "uint8"
},
{
"name": "sp_defense",
"type": "uint8"
},
{
"name": "speed",
"type": "uint8"
},
{
"name": "generation",
"type": "uint8"
},
{
"name": "legendary",
"type": "bool"
}
]
}
# Description of dataframe columns.
df_descrption = {
"count":{
"number":1072.0,
"total":1072.0,
"hp":1072.0,
"attack":1072.0,
"defense":1072.0,
"sp_attack":1072.0,
"sp_defense":1072.0,
"speed":1072.0,
"generation":1072.0
},
"mean":{
"number":445.2192164179,
"total":440.885261194,
"hp":70.4869402985,
"attack":80.9384328358,
"defense":74.9682835821,
"sp_attack":73.2733208955,
"sp_defense":72.4766791045,
"speed":68.7929104478,
"generation":4.2947761194
},
"std":{
"number":267.77280649,
"total":121.3790771926,
"hp":26.8680389923,
"attack":32.4635820748,
"defense":31.2080593873,
"sp_attack":32.6431190064,
"sp_defense":27.9342534926,
"speed":30.0762806451,
"generation":2.3464717631
},
"min":{
"number":1.0,
"total":175.0,
"hp":1.0,
"attack":5.0,
"defense":5.0,
"sp_attack":10.0,
"sp_defense":20.0,
"speed":5.0,
"generation":0.0
},
"25%":{
"number":209.75,
"total":330.0,
"hp":50.0,
"attack":56.0,
"defense":52.0,
"sp_attack":50.0,
"sp_defense":50.0,
"speed":45.0,
"generation":2.0
},
"50%":{
"number":442.5,
"total":460.5,
"hp":68.0,
"attack":80.0,
"defense":70.0,
"sp_attack":65.0,
"sp_defense":70.0,
"speed":65.0,
"generation":4.0
},
"75%":{
"number":681.25,
"total":519.25,
"hp":84.0,
"attack":100.0,
"defense":90.0,
"sp_attack":95.0,
"sp_defense":90.0,
"speed":90.0,
"generation":6.0
},
"max":{
"number":898.0,
"total":1125.0,
"hp":255.0,
"attack":190.0,
"defense":250.0,
"sp_attack":194.0,
"sp_defense":250.0,
"speed":200.0,
"generation":8.0
}
}
# Randome sample of 10 rows from the dataframe.
df_random_sample = {
"count":{
"number":1072.0,
"total":1072.0,
"hp":1072.0,
"attack":1072.0,
"defense":1072.0,
"sp_attack":1072.0,
"sp_defense":1072.0,
"speed":1072.0,
"generation":1072.0
},
"mean":{
"number":445.2192164179,
"total":440.885261194,
"hp":70.4869402985,
"attack":80.9384328358,
"defense":74.9682835821,
"sp_attack":73.2733208955,
"sp_defense":72.4766791045,
"speed":68.7929104478,
"generation":4.2947761194
},
"std":{
"number":267.77280649,
"total":121.3790771926,
"hp":26.8680389923,
"attack":32.4635820748,
"defense":31.2080593873,
"sp_attack":32.6431190064,
"sp_defense":27.9342534926,
"speed":30.0762806451,
"generation":2.3464717631
},
"min":{
"number":1.0,
"total":175.0,
"hp":1.0,
"attack":5.0,
"defense":5.0,
"sp_attack":10.0,
"sp_defense":20.0,
"speed":5.0,
"generation":0.0
},
"25%":{
"number":209.75,
"total":330.0,
"hp":50.0,
"attack":56.0,
"defense":52.0,
"sp_attack":50.0,
"sp_defense":50.0,
"speed":45.0,
"generation":2.0
},
"50%":{
"number":442.5,
"total":460.5,
"hp":68.0,
"attack":80.0,
"defense":70.0,
"sp_attack":65.0,
"sp_defense":70.0,
"speed":65.0,
"generation":4.0
},
"75%":{
"number":681.25,
"total":519.25,
"hp":84.0,
"attack":100.0,
"defense":90.0,
"sp_attack":95.0,
"sp_defense":90.0,
"speed":90.0,
"generation":6.0
},
"max":{
"number":898.0,
"total":1125.0,
"hp":255.0,
"attack":190.0,
"defense":250.0,
"sp_attack":194.0,
"sp_defense":250.0,
"speed":200.0,
"generation":8.0
}
}
'''
The question categories are:
- boolean: Valid answers include True/False, Y/N, Yes/No (all case insensitive).
- category: A value from a cell (or a substring of a cell) in the dataset.
- number: A numerical value from a cell in the dataset, which may represent a computed statistic (e.g., average, maximum, minimum).
- list[category]: A list containing a fixed number of categories. The expected format is: "['cat', 'dog']". Pay attention to the wording of the question to determine if uniqueness is required or if repeated values are allowed.
- list[number]: Similar to list[category], but with numbers as its elements.
'''
# TODO: complete the following function in one line, by completing the return statement. It should give the answer to: How many rows are there in this dataframe?
def example(df: pd.DataFrame):
df.columns=["A"]
# Expected output type: is number, this will be checked.
return df.shape[0]
# It should give the answer to: What's the highest total stat value found in the dataset?
# The answer should only contain python code, you are not allowed leave any TODO undone.
def answer(df: pd.DataFrame):
# Use df to answer: What's the highest total stat value found in the dataset?
df.columns = ['number', 'name', 'type1', 'type2', 'total', 'hp', 'attack', 'defense', 'sp_attack', 'sp_defense', 'speed', 'generation', 'legendary']
# Expected output type: is number, this will be checked.
return
|
20250129013715
|
End of preview. Expand
in Data Studio
README.md exists but content is empty.
- Downloads last month
- 3