instruction
stringclasses
183 values
input
stringclasses
1 value
output
stringclasses
183 values
Using numpy, calculate the mean of values in the salary column from a CSV file
import pandas as pd import numpy as np df = pd.read_csv('data.csv') values = df['salary'].to_numpy() print(np.mean(values))
Replace negative values with zero in the score column using numpy and pandas
import pandas as pd import numpy as np df = pd.read_csv('data.csv') df['score'] = np.where(df['score'] < 0, 0, df['score']) print(df)
Using numpy, calculate the mean of values in the quantity column from a CSV file
import pandas as pd import numpy as np df = pd.read_csv('data.csv') values = df['quantity'].to_numpy() print(np.mean(values))
Load a CSV file and filter rows where score is greater than 18
import pandas as pd df = pd.read_csv('data.csv') filtered_df = df[df['score'] > 18] print(filtered_df)
Read a CSV file and calculate the mean of the quantity column
import pandas as pd df = pd.read_csv('data.csv') print(df['quantity'].mean())
Replace negative values with zero in the quantity column using numpy and pandas
import pandas as pd import numpy as np df = pd.read_csv('data.csv') df['quantity'] = np.where(df['quantity'] < 0, 0, df['quantity']) print(df)
Read a CSV file and compute the average price grouped by region
import pandas as pd df = pd.read_csv('data.csv') result = df.groupby('region')['price'].mean() print(result)
Read a CSV file and compute the average quantity grouped by region
import pandas as pd df = pd.read_csv('data.csv') result = df.groupby('region')['quantity'].mean() print(result)
Replace negative values with zero in the price column using numpy and pandas
import pandas as pd import numpy as np df = pd.read_csv('data.csv') df['price'] = np.where(df['price'] < 0, 0, df['price']) print(df)
Using numpy, calculate the mean of values in the score column from a CSV file
import pandas as pd import numpy as np df = pd.read_csv('data.csv') values = df['score'].to_numpy() print(np.mean(values))
Using numpy, calculate the mean of values in the salary column from a CSV file
import pandas as pd import numpy as np df = pd.read_csv('data.csv') values = df['salary'].to_numpy() print(np.mean(values))
Replace negative values with zero in the salary column using numpy and pandas
import pandas as pd import numpy as np df = pd.read_csv('data.csv') df['salary'] = np.where(df['salary'] < 0, 0, df['salary']) print(df)
Load a CSV file and filter rows where price is greater than 16
import pandas as pd df = pd.read_csv('data.csv') filtered_df = df[df['price'] > 16] print(filtered_df)
Read a CSV file and calculate the mean of the age column
import pandas as pd df = pd.read_csv('data.csv') print(df['age'].mean())
Load a CSV file and filter rows where quantity is greater than 10
import pandas as pd df = pd.read_csv('data.csv') filtered_df = df[df['quantity'] > 10] print(filtered_df)
Read a CSV file and compute the average price grouped by department
import pandas as pd df = pd.read_csv('data.csv') result = df.groupby('department')['price'].mean() print(result)
Load a CSV file and filter rows where price is greater than 17
import pandas as pd df = pd.read_csv('data.csv') filtered_df = df[df['price'] > 17] print(filtered_df)
Using numpy, calculate the mean of values in the age column from a CSV file
import pandas as pd import numpy as np df = pd.read_csv('data.csv') values = df['age'].to_numpy() print(np.mean(values))
Read a CSV file and compute the average price grouped by region
import pandas as pd df = pd.read_csv('data.csv') result = df.groupby('region')['price'].mean() print(result)
Read a CSV file and calculate the mean of the price column
import pandas as pd df = pd.read_csv('data.csv') print(df['price'].mean())
Replace negative values with zero in the salary column using numpy and pandas
import pandas as pd import numpy as np df = pd.read_csv('data.csv') df['salary'] = np.where(df['salary'] < 0, 0, df['salary']) print(df)
Using numpy, calculate the mean of values in the age column from a CSV file
import pandas as pd import numpy as np df = pd.read_csv('data.csv') values = df['age'].to_numpy() print(np.mean(values))
Load a CSV file and filter rows where score is greater than 15
import pandas as pd df = pd.read_csv('data.csv') filtered_df = df[df['score'] > 15] print(filtered_df)
Load a CSV file and filter rows where score is greater than 50
import pandas as pd df = pd.read_csv('data.csv') filtered_df = df[df['score'] > 50] print(filtered_df)
Using numpy, calculate the mean of values in the price column from a CSV file
import pandas as pd import numpy as np df = pd.read_csv('data.csv') values = df['price'].to_numpy() print(np.mean(values))
Using numpy, calculate the mean of values in the score column from a CSV file
import pandas as pd import numpy as np df = pd.read_csv('data.csv') values = df['score'].to_numpy() print(np.mean(values))
Using numpy, calculate the mean of values in the price column from a CSV file
import pandas as pd import numpy as np df = pd.read_csv('data.csv') values = df['price'].to_numpy() print(np.mean(values))
Read a CSV file and calculate the mean of the age column
import pandas as pd df = pd.read_csv('data.csv') print(df['age'].mean())
Load a CSV file and filter rows where quantity is greater than 36
import pandas as pd df = pd.read_csv('data.csv') filtered_df = df[df['quantity'] > 36] print(filtered_df)
Read a CSV file and compute the average age grouped by department
import pandas as pd df = pd.read_csv('data.csv') result = df.groupby('department')['age'].mean() print(result)
Read a CSV file and compute the average salary grouped by category
import pandas as pd df = pd.read_csv('data.csv') result = df.groupby('category')['salary'].mean() print(result)
Load a CSV file and filter rows where price is greater than 46
import pandas as pd df = pd.read_csv('data.csv') filtered_df = df[df['price'] > 46] print(filtered_df)
Read a CSV file and calculate the mean of the quantity column
import pandas as pd df = pd.read_csv('data.csv') print(df['quantity'].mean())
Load a CSV file and filter rows where salary is greater than 21
import pandas as pd df = pd.read_csv('data.csv') filtered_df = df[df['salary'] > 21] print(filtered_df)
Replace negative values with zero in the quantity column using numpy and pandas
import pandas as pd import numpy as np df = pd.read_csv('data.csv') df['quantity'] = np.where(df['quantity'] < 0, 0, df['quantity']) print(df)
Replace negative values with zero in the age column using numpy and pandas
import pandas as pd import numpy as np df = pd.read_csv('data.csv') df['age'] = np.where(df['age'] < 0, 0, df['age']) print(df)
Load a CSV file and filter rows where quantity is greater than 27
import pandas as pd df = pd.read_csv('data.csv') filtered_df = df[df['quantity'] > 27] print(filtered_df)
Replace negative values with zero in the score column using numpy and pandas
import pandas as pd import numpy as np df = pd.read_csv('data.csv') df['score'] = np.where(df['score'] < 0, 0, df['score']) print(df)
Replace negative values with zero in the age column using numpy and pandas
import pandas as pd import numpy as np df = pd.read_csv('data.csv') df['age'] = np.where(df['age'] < 0, 0, df['age']) print(df)
Read a CSV file and calculate the mean of the age column
import pandas as pd df = pd.read_csv('data.csv') print(df['age'].mean())
Replace negative values with zero in the quantity column using numpy and pandas
import pandas as pd import numpy as np df = pd.read_csv('data.csv') df['quantity'] = np.where(df['quantity'] < 0, 0, df['quantity']) print(df)
Read a CSV file and compute the average salary grouped by category
import pandas as pd df = pd.read_csv('data.csv') result = df.groupby('category')['salary'].mean() print(result)
Load a CSV file and filter rows where quantity is greater than 22
import pandas as pd df = pd.read_csv('data.csv') filtered_df = df[df['quantity'] > 22] print(filtered_df)
Read a CSV file and calculate the mean of the price column
import pandas as pd df = pd.read_csv('data.csv') print(df['price'].mean())
Read a CSV file and calculate the mean of the price column
import pandas as pd df = pd.read_csv('data.csv') print(df['price'].mean())
Read a CSV file and compute the average quantity grouped by region
import pandas as pd df = pd.read_csv('data.csv') result = df.groupby('region')['quantity'].mean() print(result)
Read a CSV file and calculate the mean of the score column
import pandas as pd df = pd.read_csv('data.csv') print(df['score'].mean())
Replace negative values with zero in the quantity column using numpy and pandas
import pandas as pd import numpy as np df = pd.read_csv('data.csv') df['quantity'] = np.where(df['quantity'] < 0, 0, df['quantity']) print(df)
Using numpy, calculate the mean of values in the price column from a CSV file
import pandas as pd import numpy as np df = pd.read_csv('data.csv') values = df['price'].to_numpy() print(np.mean(values))
Replace negative values with zero in the salary column using numpy and pandas
import pandas as pd import numpy as np df = pd.read_csv('data.csv') df['salary'] = np.where(df['salary'] < 0, 0, df['salary']) print(df)
Load a CSV file and filter rows where score is greater than 49
import pandas as pd df = pd.read_csv('data.csv') filtered_df = df[df['score'] > 49] print(filtered_df)
Read a CSV file and calculate the mean of the salary column
import pandas as pd df = pd.read_csv('data.csv') print(df['salary'].mean())
Load a CSV file and filter rows where score is greater than 29
import pandas as pd df = pd.read_csv('data.csv') filtered_df = df[df['score'] > 29] print(filtered_df)
Read a CSV file and calculate the mean of the salary column
import pandas as pd df = pd.read_csv('data.csv') print(df['salary'].mean())
Read a CSV file and compute the average salary grouped by department
import pandas as pd df = pd.read_csv('data.csv') result = df.groupby('department')['salary'].mean() print(result)
Replace negative values with zero in the score column using numpy and pandas
import pandas as pd import numpy as np df = pd.read_csv('data.csv') df['score'] = np.where(df['score'] < 0, 0, df['score']) print(df)
Read a CSV file and compute the average salary grouped by category
import pandas as pd df = pd.read_csv('data.csv') result = df.groupby('category')['salary'].mean() print(result)
Using numpy, calculate the mean of values in the quantity column from a CSV file
import pandas as pd import numpy as np df = pd.read_csv('data.csv') values = df['quantity'].to_numpy() print(np.mean(values))
Replace negative values with zero in the quantity column using numpy and pandas
import pandas as pd import numpy as np df = pd.read_csv('data.csv') df['quantity'] = np.where(df['quantity'] < 0, 0, df['quantity']) print(df)
Replace negative values with zero in the salary column using numpy and pandas
import pandas as pd import numpy as np df = pd.read_csv('data.csv') df['salary'] = np.where(df['salary'] < 0, 0, df['salary']) print(df)
Replace negative values with zero in the score column using numpy and pandas
import pandas as pd import numpy as np df = pd.read_csv('data.csv') df['score'] = np.where(df['score'] < 0, 0, df['score']) print(df)
Using numpy, calculate the mean of values in the age column from a CSV file
import pandas as pd import numpy as np df = pd.read_csv('data.csv') values = df['age'].to_numpy() print(np.mean(values))
Read a CSV file and compute the average quantity grouped by department
import pandas as pd df = pd.read_csv('data.csv') result = df.groupby('department')['quantity'].mean() print(result)
Using numpy, calculate the mean of values in the salary column from a CSV file
import pandas as pd import numpy as np df = pd.read_csv('data.csv') values = df['salary'].to_numpy() print(np.mean(values))
Replace negative values with zero in the score column using numpy and pandas
import pandas as pd import numpy as np df = pd.read_csv('data.csv') df['score'] = np.where(df['score'] < 0, 0, df['score']) print(df)
Load a CSV file and filter rows where salary is greater than 41
import pandas as pd df = pd.read_csv('data.csv') filtered_df = df[df['salary'] > 41] print(filtered_df)
Replace negative values with zero in the quantity column using numpy and pandas
import pandas as pd import numpy as np df = pd.read_csv('data.csv') df['quantity'] = np.where(df['quantity'] < 0, 0, df['quantity']) print(df)
Load a CSV file and filter rows where price is greater than 16
import pandas as pd df = pd.read_csv('data.csv') filtered_df = df[df['price'] > 16] print(filtered_df)
Using numpy, calculate the mean of values in the age column from a CSV file
import pandas as pd import numpy as np df = pd.read_csv('data.csv') values = df['age'].to_numpy() print(np.mean(values))
Read a CSV file and compute the average salary grouped by region
import pandas as pd df = pd.read_csv('data.csv') result = df.groupby('region')['salary'].mean() print(result)
Using numpy, calculate the mean of values in the quantity column from a CSV file
import pandas as pd import numpy as np df = pd.read_csv('data.csv') values = df['quantity'].to_numpy() print(np.mean(values))
Read a CSV file and compute the average quantity grouped by region
import pandas as pd df = pd.read_csv('data.csv') result = df.groupby('region')['quantity'].mean() print(result)
Read a CSV file and calculate the mean of the age column
import pandas as pd df = pd.read_csv('data.csv') print(df['age'].mean())
Using numpy, calculate the mean of values in the quantity column from a CSV file
import pandas as pd import numpy as np df = pd.read_csv('data.csv') values = df['quantity'].to_numpy() print(np.mean(values))
Load a CSV file and filter rows where age is greater than 20
import pandas as pd df = pd.read_csv('data.csv') filtered_df = df[df['age'] > 20] print(filtered_df)
Read a CSV file and compute the average price grouped by department
import pandas as pd df = pd.read_csv('data.csv') result = df.groupby('department')['price'].mean() print(result)
Replace negative values with zero in the score column using numpy and pandas
import pandas as pd import numpy as np df = pd.read_csv('data.csv') df['score'] = np.where(df['score'] < 0, 0, df['score']) print(df)
Load a CSV file and filter rows where salary is greater than 42
import pandas as pd df = pd.read_csv('data.csv') filtered_df = df[df['salary'] > 42] print(filtered_df)
Replace negative values with zero in the quantity column using numpy and pandas
import pandas as pd import numpy as np df = pd.read_csv('data.csv') df['quantity'] = np.where(df['quantity'] < 0, 0, df['quantity']) print(df)
Read a CSV file and calculate the mean of the age column
import pandas as pd df = pd.read_csv('data.csv') print(df['age'].mean())
Read a CSV file and compute the average quantity grouped by department
import pandas as pd df = pd.read_csv('data.csv') result = df.groupby('department')['quantity'].mean() print(result)
Replace negative values with zero in the age column using numpy and pandas
import pandas as pd import numpy as np df = pd.read_csv('data.csv') df['age'] = np.where(df['age'] < 0, 0, df['age']) print(df)
Read a CSV file and calculate the mean of the age column
import pandas as pd df = pd.read_csv('data.csv') print(df['age'].mean())
Read a CSV file and calculate the mean of the price column
import pandas as pd df = pd.read_csv('data.csv') print(df['price'].mean())
Read a CSV file and compute the average salary grouped by region
import pandas as pd df = pd.read_csv('data.csv') result = df.groupby('region')['salary'].mean() print(result)
Read a CSV file and calculate the mean of the price column
import pandas as pd df = pd.read_csv('data.csv') print(df['price'].mean())
Using numpy, calculate the mean of values in the score column from a CSV file
import pandas as pd import numpy as np df = pd.read_csv('data.csv') values = df['score'].to_numpy() print(np.mean(values))
Using numpy, calculate the mean of values in the age column from a CSV file
import pandas as pd import numpy as np df = pd.read_csv('data.csv') values = df['age'].to_numpy() print(np.mean(values))
Replace negative values with zero in the salary column using numpy and pandas
import pandas as pd import numpy as np df = pd.read_csv('data.csv') df['salary'] = np.where(df['salary'] < 0, 0, df['salary']) print(df)
Read a CSV file and calculate the mean of the score column
import pandas as pd df = pd.read_csv('data.csv') print(df['score'].mean())
Using numpy, calculate the mean of values in the score column from a CSV file
import pandas as pd import numpy as np df = pd.read_csv('data.csv') values = df['score'].to_numpy() print(np.mean(values))
Replace negative values with zero in the score column using numpy and pandas
import pandas as pd import numpy as np df = pd.read_csv('data.csv') df['score'] = np.where(df['score'] < 0, 0, df['score']) print(df)
Replace negative values with zero in the age column using numpy and pandas
import pandas as pd import numpy as np df = pd.read_csv('data.csv') df['age'] = np.where(df['age'] < 0, 0, df['age']) print(df)
Using numpy, calculate the mean of values in the age column from a CSV file
import pandas as pd import numpy as np df = pd.read_csv('data.csv') values = df['age'].to_numpy() print(np.mean(values))
Replace negative values with zero in the age column using numpy and pandas
import pandas as pd import numpy as np df = pd.read_csv('data.csv') df['age'] = np.where(df['age'] < 0, 0, df['age']) print(df)
Load a CSV file and filter rows where age is greater than 23
import pandas as pd df = pd.read_csv('data.csv') filtered_df = df[df['age'] > 23] print(filtered_df)
Read a CSV file and calculate the mean of the price column
import pandas as pd df = pd.read_csv('data.csv') print(df['price'].mean())
Read a CSV file and compute the average salary grouped by department
import pandas as pd df = pd.read_csv('data.csv') result = df.groupby('department')['salary'].mean() print(result)
Read a CSV file and compute the average age grouped by department
import pandas as pd df = pd.read_csv('data.csv') result = df.groupby('department')['age'].mean() print(result)
Read a CSV file and calculate the mean of the age column
import pandas as pd df = pd.read_csv('data.csv') print(df['age'].mean())