Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed
Error code:   DatasetGenerationError
Exception:    CastError
Message:      Couldn't cast
problem_id: int64
sample: int64
completion: string
code: string
ast_valid: bool
graph_vertex_class: string
instruction: string
id: int64
graph_vertex_subclass: string
to
{'id': Value('int64'), 'graph_vertex_class': Value('string'), 'graph_vertex_subclass': Value('string'), 'instruction': Value('string'), 'completion': Value('string'), 'code': Value('string'), 'ast_valid': Value('bool')}
because column names don't match
Traceback:    Traceback (most recent call last):
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1835, in _prepare_split_single
                  for key, table in generator:
                                    ^^^^^^^^^
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 621, in wrapped
                  for item in generator(*args, **kwargs):
                              ~~~~~~~~~^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 361, in _generate_tables
                  self._cast_table(pa_table, json_field_paths=json_field_paths),
                  ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 132, in _cast_table
                  pa_table = table_cast(pa_table, self.info.features.arrow_schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2381, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2309, in cast_table_to_schema
                  raise CastError(
                  ...<3 lines>...
                  )
              datasets.table.CastError: Couldn't cast
              problem_id: int64
              sample: int64
              completion: string
              code: string
              ast_valid: bool
              graph_vertex_class: string
              instruction: string
              id: int64
              graph_vertex_subclass: string
              to
              {'id': Value('int64'), 'graph_vertex_class': Value('string'), 'graph_vertex_subclass': Value('string'), 'instruction': Value('string'), 'completion': Value('string'), 'code': Value('string'), 'ast_valid': Value('bool')}
              because column names don't match
              
              The above exception was the direct cause of the following exception:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1379, in compute_config_parquet_and_info_response
                  parquet_operations, partial, estimated_dataset_info = stream_convert_to_parquet(
                                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~^
                      builder, max_dataset_size_bytes=max_dataset_size_bytes
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  )
                  ^
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 956, in stream_convert_to_parquet
                  builder._prepare_split(split_generator=splits_generators[split], file_format="parquet")
                  ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1702, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~^
                      gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  ):
                  ^
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1887, in _prepare_split_single
                  raise DatasetGenerationError("An error occurred while generating the dataset") from e
              datasets.exceptions.DatasetGenerationError: An error occurred while generating the dataset

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

id
int64
graph_vertex_class
string
graph_vertex_subclass
string
instruction
string
completion
string
code
string
ast_valid
bool
3,413
Data_Export
prepare_output
Write Python code to prepare the output for submission.
ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainÄ andÄ testÄ setsÄŠfromÄ sklearn.model_selectionÄ importÄ train_test_splitÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠÄŠ#Ä CreateÄ aÄ functionÄ toÄ predictÄ theÄ targetÄ variableÄŠdefÄ predict_target(X_train,Ä y_train,Ä X_test,Ä y_test):ÄŠÄ Ä Ä Ä fromÄ sklearn.ensembleÄ i...
ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainÄ andÄ testÄ setsÄŠfromÄ sklearn.model_selectionÄ importÄ train_test_splitÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠÄŠ#Ä CreateÄ aÄ functionÄ toÄ predictÄ theÄ targetÄ variableÄŠdefÄ predict_target(X_train,Ä y_train,Ä X_test,Ä y_test):ÄŠÄ Ä Ä Ä fromÄ sklearn.ensembleÄ i...
true
3,221
Data_Export
save_to_csv
Write Python code to save the results to a CSV file.
ÄŠÄŠ#Ä SaveÄ theÄ resultÄ toÄ aÄ CSVÄ fileÄŠresult.to_csv('submission.csv',Ä index=False)ÄŠ
ÄŠÄŠ#Ä SaveÄ theÄ resultÄ toÄ aÄ CSVÄ fileÄŠresult.to_csv('submission.csv',Ä index=False)ÄŠ
true
1,521
Data_Export
save_to_csv
Write Python code to save the results to a CSV file.
ÄŠÄŠ#Ä SaveÄ theÄ resultÄ toÄ aÄ CSVÄ fileÄŠresult.to_csv('submission.csv',Ä index=False)ÄŠ
ÄŠÄŠ#Ä SaveÄ theÄ resultÄ toÄ aÄ CSVÄ fileÄŠresult.to_csv('submission.csv',Ä index=False)ÄŠ
true
545
Data_Export
save_to_csv
Write Python code to save the results to a CSV file.
ÄŠÄŠ#Ä SaveÄ theÄ resultÄ toÄ aÄ CSVÄ fileÄŠresult.to_csv('submission.csv',Ä index=False)ÄŠ
ÄŠÄŠ#Ä SaveÄ theÄ resultÄ toÄ aÄ CSVÄ fileÄŠresult.to_csv('submission.csv',Ä index=False)ÄŠ
true
640
Data_Export
prepare_output
Write Python code to prepare the output for submission.
ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainÄ andÄ testÄ setsÄŠfromÄ sklearn.model_selectionÄ importÄ train_test_splitÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠÄŠ#Ä CreateÄ aÄ functionÄ toÄ predictÄ theÄ targetÄ variableÄŠdefÄ predict_target(X_train,Ä y_train,Ä X_test,Ä y_test):ÄŠÄ Ä Ä Ä fromÄ sklearn.ensembleÄ i...
ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainÄ andÄ testÄ setsÄŠfromÄ sklearn.model_selectionÄ importÄ train_test_splitÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠÄŠ#Ä CreateÄ aÄ functionÄ toÄ predictÄ theÄ targetÄ variableÄŠdefÄ predict_target(X_train,Ä y_train,Ä X_test,Ä y_test):ÄŠÄ Ä Ä Ä fromÄ sklearn.ensembleÄ i...
true
4,987
Data_Export
save_to_csv
Write Python code to save the results to a CSV file.
ÄŠÄŠ#Ä SaveÄ theÄ resultÄ toÄ aÄ CSVÄ fileÄŠresult.to_csv('submission.csv',Ä index=False)ÄŠ
ÄŠÄŠ#Ä SaveÄ theÄ resultÄ toÄ aÄ CSVÄ fileÄŠresult.to_csv('submission.csv',Ä index=False)ÄŠ
true
6,634
Data_Export
save_to_csv
Write Python code to save the results to a CSV file.
ÄŠÄŠ#Ä SaveÄ theÄ resultÄ toÄ aÄ CSVÄ fileÄŠresult.to_csv('submission.csv',Ä index=False)ÄŠ
ÄŠÄŠ#Ä SaveÄ theÄ resultÄ toÄ aÄ CSVÄ fileÄŠresult.to_csv('submission.csv',Ä index=False)ÄŠ
true
1,482
Data_Export
save_to_csv
Write Python code to save the results to a CSV file.
ÄŠÄŠ#Ä SaveÄ theÄ resultÄ toÄ aÄ CSVÄ fileÄŠresult.to_csv('submission.csv',Ä index=False)ÄŠ
ÄŠÄŠ#Ä SaveÄ theÄ resultÄ toÄ aÄ CSVÄ fileÄŠresult.to_csv('submission.csv',Ä index=False)ÄŠ
true
6,345
Data_Export
prepare_output
Write Python code to prepare the output for submission.
ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainÄ andÄ testÄ setsÄŠfromÄ sklearn.model_selectionÄ importÄ train_test_splitÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠÄŠ#Ä CreateÄ aÄ functionÄ toÄ predictÄ theÄ targetÄ variableÄŠdefÄ predict_target(X_train,Ä y_train,Ä X_test,Ä y_test):ÄŠÄ Ä Ä Ä fromÄ sklearn.ensembleÄ i...
ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainÄ andÄ testÄ setsÄŠfromÄ sklearn.model_selectionÄ importÄ train_test_splitÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠÄŠ#Ä CreateÄ aÄ functionÄ toÄ predictÄ theÄ targetÄ variableÄŠdefÄ predict_target(X_train,Ä y_train,Ä X_test,Ä y_test):ÄŠÄ Ä Ä Ä fromÄ sklearn.ensembleÄ i...
true
7,463
Data_Export
prepare_output
Write Python code to prepare the output for submission.
ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainÄ andÄ testÄ setsÄŠfromÄ sklearn.model_selectionÄ importÄ train_test_splitÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠÄŠ#Ä CreateÄ aÄ functionÄ toÄ predictÄ theÄ targetÄ variableÄŠdefÄ predict_target(X_train,Ä y_train,Ä X_test,Ä y_test):ÄŠÄ Ä Ä Ä fromÄ sklearn.ensembleÄ i...
ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainÄ andÄ testÄ setsÄŠfromÄ sklearn.model_selectionÄ importÄ train_test_splitÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠÄŠ#Ä CreateÄ aÄ functionÄ toÄ predictÄ theÄ targetÄ variableÄŠdefÄ predict_target(X_train,Ä y_train,Ä X_test,Ä y_test):ÄŠÄ Ä Ä Ä fromÄ sklearn.ensembleÄ i...
true
1,642
Data_Export
save_to_csv
Write Python code to save the results to a CSV file.
ÄŠÄŠ#Ä SaveÄ theÄ resultÄ toÄ aÄ CSVÄ fileÄŠresult.to_csv('submission.csv',Ä index=False)ÄŠ
ÄŠÄŠ#Ä SaveÄ theÄ resultÄ toÄ aÄ CSVÄ fileÄŠresult.to_csv('submission.csv',Ä index=False)ÄŠ
true
1,930
Data_Export
save_to_csv
Write Python code to save the results to a CSV file.
ÄŠÄŠ#Ä SaveÄ theÄ resultÄ toÄ aÄ CSVÄ fileÄŠresult.to_csv('submission.csv',Ä index=False)ÄŠ
ÄŠÄŠ#Ä SaveÄ theÄ resultÄ toÄ aÄ CSVÄ fileÄŠresult.to_csv('submission.csv',Ä index=False)ÄŠ
true
3,388
Data_Export
prepare_output
Write Python code to prepare the output for submission.
ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainÄ andÄ testÄ setsÄŠfromÄ sklearn.model_selectionÄ importÄ train_test_splitÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠÄŠ#Ä CreateÄ aÄ functionÄ toÄ predictÄ theÄ targetÄ variableÄŠdefÄ predict_target(X_train,Ä y_train,Ä X_test,Ä y_test):ÄŠÄ Ä Ä Ä fromÄ sklearn.ensembleÄ i...
ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainÄ andÄ testÄ setsÄŠfromÄ sklearn.model_selectionÄ importÄ train_test_splitÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠÄŠ#Ä CreateÄ aÄ functionÄ toÄ predictÄ theÄ targetÄ variableÄŠdefÄ predict_target(X_train,Ä y_train,Ä X_test,Ä y_test):ÄŠÄ Ä Ä Ä fromÄ sklearn.ensembleÄ i...
true
3,465
Data_Export
prepare_output
Write Python code to prepare the output for submission.
ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainÄ andÄ testÄ setsÄŠfromÄ sklearn.model_selectionÄ importÄ train_test_splitÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠÄŠ#Ä CreateÄ aÄ functionÄ toÄ predictÄ theÄ targetÄ variableÄŠdefÄ predict_target(X_train,Ä y_train,Ä X_test,Ä y_test):ÄŠÄ Ä Ä Ä fromÄ sklearn.ensembleÄ i...
ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainÄ andÄ testÄ setsÄŠfromÄ sklearn.model_selectionÄ importÄ train_test_splitÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠÄŠ#Ä CreateÄ aÄ functionÄ toÄ predictÄ theÄ targetÄ variableÄŠdefÄ predict_target(X_train,Ä y_train,Ä X_test,Ä y_test):ÄŠÄ Ä Ä Ä fromÄ sklearn.ensembleÄ i...
true
3,702
Data_Export
save_to_csv
Write Python code to save the results to a CSV file.
ÄŠÄŠ#Ä SaveÄ theÄ resultÄ toÄ aÄ CSVÄ fileÄŠresult.to_csv('submission.csv',Ä index=False)ÄŠ
ÄŠÄŠ#Ä SaveÄ theÄ resultÄ toÄ aÄ CSVÄ fileÄŠresult.to_csv('submission.csv',Ä index=False)ÄŠ
true
534
Data_Export
save_to_csv
Write Python code to save the results to a CSV file.
ÄŠÄŠ#Ä SaveÄ theÄ resultÄ toÄ aÄ CSVÄ fileÄŠresult.to_csv('submission.csv',Ä index=False)ÄŠ
ÄŠÄŠ#Ä SaveÄ theÄ resultÄ toÄ aÄ CSVÄ fileÄŠresult.to_csv('submission.csv',Ä index=False)ÄŠ
true
1,644
Data_Export
save_to_csv
Write Python code to save the results to a CSV file.
ÄŠÄŠ#Ä SaveÄ theÄ resultÄ toÄ aÄ CSVÄ fileÄŠresult.to_csv('submission.csv',Ä index=False)ÄŠ
ÄŠÄŠ#Ä SaveÄ theÄ resultÄ toÄ aÄ CSVÄ fileÄŠresult.to_csv('submission.csv',Ä index=False)ÄŠ
true
7,065
Data_Export
save_to_csv
Write Python code to save the results to a CSV file.
ÄŠÄŠ#Ä SaveÄ theÄ resultÄ toÄ aÄ CSVÄ fileÄŠresult.to_csv('submission.csv',Ä index=False)ÄŠ
ÄŠÄŠ#Ä SaveÄ theÄ resultÄ toÄ aÄ CSVÄ fileÄŠresult.to_csv('submission.csv',Ä index=False)ÄŠ
true
3,099
Data_Extraction
load_from_csv
Write Python code to load the data from a CSV file.
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
true
6,237
Data_Extraction
load_from_disk
Write Python code to load the data from disk.
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ diskÄŠtrain_dataÄ =Ä pd.read_csv('../input/train.csv')ÄŠtest_dataÄ =Ä pd.read_csv('../input/test.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠtrain_data.head()ÄŠtest_data.head()ÄŠ
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ diskÄŠtrain_dataÄ =Ä pd.read_csv('../input/train.csv')ÄŠtest_dataÄ =Ä pd.read_csv('../input/test.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠtrain_data.head()ÄŠtest_data.head()ÄŠ
true
1,973
Data_Extraction
load_from_csv
Write Python code to load the data from a CSV file.
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
true
6,132
Data_Extraction
load_from_disk
Write Python code to load the data from disk.
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ diskÄŠtrain_dataÄ =Ä pd.read_csv('../input/train.csv')ÄŠtest_dataÄ =Ä pd.read_csv('../input/test.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠtrain_data.head()ÄŠtest_data.head()ÄŠ
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ diskÄŠtrain_dataÄ =Ä pd.read_csv('../input/train.csv')ÄŠtest_dataÄ =Ä pd.read_csv('../input/test.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠtrain_data.head()ÄŠtest_data.head()ÄŠ
true
6,319
Data_Extraction
load_from_csv
Write Python code to load the data from a CSV file.
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
true
6,421
Data_Extraction
load_from_csv
Write Python code to load the data from a CSV file.
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
true
4,992
Data_Extraction
load_from_csv
Write Python code to load the data from a CSV file.
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
true
2,150
Data_Extraction
load_from_csv
Write Python code to load the data from a CSV file.
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
true
4,109
Data_Extraction
load_from_csv
Write Python code to load the data from a CSV file.
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
true
5,739
Data_Extraction
load_from_csv
Write Python code to load the data from a CSV file.
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
true
7,429
Data_Extraction
load_from_csv
Write Python code to load the data from a CSV file.
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
true
4,952
Data_Extraction
load_from_csv
Write Python code to load the data from a CSV file.
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
true
2,768
Data_Extraction
load_from_csv
Write Python code to load the data from a CSV file.
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
true
1,670
Data_Extraction
load_from_csv
Write Python code to load the data from a CSV file.
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
true
5,023
Data_Extraction
load_from_csv
Write Python code to load the data from a CSV file.
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
true
4,393
Data_Extraction
load_from_csv
Write Python code to load the data from a CSV file.
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
true
5,958
Data_Extraction
load_from_csv
Write Python code to load the data from a CSV file.
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
true
7,609
Data_Extraction
load_from_csv
Write Python code to load the data from a CSV file.
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
true
1,231
Data_Extraction
load_from_csv
Write Python code to load the data from a CSV file.
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
true
6,491
Data_Extraction
load_from_csv
Write Python code to load the data from a CSV file.
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
true
4,990
Data_Extraction
load_from_csv
Write Python code to load the data from a CSV file.
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
true
6,438
Data_Extraction
load_from_csv
Write Python code to load the data from a CSV file.
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
true
546
Data_Extraction
load_from_csv
Write Python code to load the data from a CSV file.
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
true
6,985
Data_Extraction
load_from_csv
Write Python code to load the data from a CSV file.
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
ÄŠÄŠ#Ä LoadÄ theÄ dataÄ fromÄ aÄ CSVÄ fileÄŠimportÄ pandasÄ asÄ pdÄŠÄŠ#Ä LoadÄ theÄ dataÄŠdataÄ =Ä pd.read_csv('../input/train.csv')ÄŠÄŠ#Ä CheckÄ theÄ dataÄŠdata.head()ÄŠ
true
3,065
Data_Transform
feature_engineering
Write Python code to engineer new features.
ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ monthÄŠtrain['month_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.day)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ yearÄŠtrain['year_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.year)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ quarterÄŠtrain['quarter_days'...
ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ monthÄŠtrain['month_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.day)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ yearÄŠtrain['year_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.year)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ quarterÄŠtrain['quarter_days'...
true
4,052
Data_Transform
feature_engineering
Write Python code to engineer new features.
ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ monthÄŠtrain['month_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.day)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ yearÄŠtrain['year_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.year)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ quarterÄŠtrain['quarter_days'...
ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ monthÄŠtrain['month_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.day)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ yearÄŠtrain['year_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.year)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ quarterÄŠtrain['quarter_days'...
true
3,210
Data_Transform
split
Write Python code to split the data into training and test sets.
ÄŠÄŠ#Ä SplittingÄ theÄ dataÄ intoÄ trainingÄ andÄ testÄ setsÄŠfromÄ sklearn.model_selectionÄ importÄ train_test_splitÄŠÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠ
ÄŠÄŠ#Ä SplittingÄ theÄ dataÄ intoÄ trainingÄ andÄ testÄ setsÄŠfromÄ sklearn.model_selectionÄ importÄ train_test_splitÄŠÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠ
true
1,477
Data_Transform
feature_engineering
Write Python code to engineer new features.
ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ monthÄŠtrain['month_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.day)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ yearÄŠtrain['year_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.year)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ quarterÄŠtrain['quarter_days'...
ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ monthÄŠtrain['month_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.day)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ yearÄŠtrain['year_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.year)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ quarterÄŠtrain['quarter_days'...
true
4,309
Data_Transform
split
Write Python code to split the data into training and test sets.
ÄŠÄŠ#Ä SplittingÄ theÄ dataÄ intoÄ trainingÄ andÄ testÄ setsÄŠfromÄ sklearn.model_selectionÄ importÄ train_test_splitÄŠÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠ
ÄŠÄŠ#Ä SplittingÄ theÄ dataÄ intoÄ trainingÄ andÄ testÄ setsÄŠfromÄ sklearn.model_selectionÄ importÄ train_test_splitÄŠÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠ
true
6,412
Data_Transform
feature_engineering
Write Python code to engineer new features.
ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ monthÄŠtrain['month_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.day)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ yearÄŠtrain['year_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.year)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ quarterÄŠtrain['quarter_days'...
ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ monthÄŠtrain['month_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.day)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ yearÄŠtrain['year_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.year)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ quarterÄŠtrain['quarter_days'...
true
3,876
Data_Transform
data_type_conversions
Write Python code to convert the column data types.
ÄŠÄŠ#Ä ConvertÄ theÄ columnÄ datatypesÄŠtrain_data['datetime']Ä =Ä pd.to_datetime(train_data['datetime'])ÄŠtrain_data['year']Ä =Ä train_data['datetime'].dt.yearÄŠtrain_data['month']Ä =Ä train_data['datetime'].dt.monthÄŠtrain_data['day']Ä =Ä train_data['datetime'].dt.dayÄŠtrain_data['hour']Ä =Ä train_data['datetime'].dt.hourÄŠtrain_data['wee...
ÄŠÄŠ#Ä ConvertÄ theÄ columnÄ datatypesÄŠtrain_data['datetime']Ä =Ä pd.to_datetime(train_data['datetime'])ÄŠtrain_data['year']Ä =Ä train_data['datetime'].dt.yearÄŠtrain_data['month']Ä =Ä train_data['datetime'].dt.monthÄŠtrain_data['day']Ä =Ä train_data['datetime'].dt.dayÄŠtrain_data['hour']Ä =Ä train_data['datetime'].dt.hourÄŠtrain_data['wee...
true
1,411
Data_Transform
feature_engineering
Write Python code to engineer new features.
ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ monthÄŠtrain['month_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.day)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ yearÄŠtrain['year_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.year)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ quarterÄŠtrain['quarter_days'...
ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ monthÄŠtrain['month_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.day)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ yearÄŠtrain['year_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.year)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ quarterÄŠtrain['quarter_days'...
true
2,402
Data_Transform
prepare_x_and_y
Write Python code to separate the features and the target.
ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ featuresÄ andÄ targetÄŠXÄ =Ä df.drop('count',Ä axis=1)ÄŠyÄ =Ä df['count']ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ testingÄ setsÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ validationÄ setsÄŠX_train,Ä X_val,Ä y_train,Ä y_valÄ =Ä train_t...
ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ featuresÄ andÄ targetÄŠXÄ =Ä df.drop('count',Ä axis=1)ÄŠyÄ =Ä df['count']ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ testingÄ setsÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ validationÄ setsÄŠX_train,Ä X_val,Ä y_train,Ä y_valÄ =Ä train_t...
true
6,011
Data_Transform
prepare_x_and_y
Write Python code to separate the features and the target.
ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ featuresÄ andÄ targetÄŠXÄ =Ä df.drop('count',Ä axis=1)ÄŠyÄ =Ä df['count']ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ testingÄ setsÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ validationÄ setsÄŠX_train,Ä X_val,Ä y_train,Ä y_valÄ =Ä train_t...
ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ featuresÄ andÄ targetÄŠXÄ =Ä df.drop('count',Ä axis=1)ÄŠyÄ =Ä df['count']ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ testingÄ setsÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ validationÄ setsÄŠX_train,Ä X_val,Ä y_train,Ä y_valÄ =Ä train_t...
true
6,347
Data_Transform
feature_engineering
Write Python code to engineer new features.
ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ monthÄŠtrain['month_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.day)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ yearÄŠtrain['year_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.year)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ quarterÄŠtrain['quarter_days'...
ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ monthÄŠtrain['month_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.day)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ yearÄŠtrain['year_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.year)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ quarterÄŠtrain['quarter_days'...
true
2,904
Data_Transform
categorify
Write Python code to encode the categorical features.
ÄŠÄŠ#Ä EncodingÄ categoricalÄ featuresÄŠÄŠ#Ä ConvertÄ categoricalÄ variablesÄ toÄ numericÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#Ä One-hotÄ encodingÄ ofÄ categoricalÄ variablesÄŠÄŠ#Ä One-hotÄ encodingÄ ofÄ categoricalÄ variablesÄŠÄŠ#Ä One-hotÄ encodingÄ ofÄ categoricalÄ variablesÄŠÄŠ#Ä One-hotÄ encodingÄ ofÄ categoricalÄ variablesÄŠÄŠ#Ä One-hotÄ encodingÄ ofÄ categoricalÄ variabl...
ÄŠÄŠ#Ä EncodingÄ categoricalÄ featuresÄŠÄŠ#Ä ConvertÄ categoricalÄ variablesÄ toÄ numericÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#Ä One-hotÄ encodingÄ ofÄ categoricalÄ variablesÄŠÄŠ#Ä One-hotÄ encodingÄ ofÄ categoricalÄ variablesÄŠÄŠ#Ä One-hotÄ encodingÄ ofÄ categoricalÄ variablesÄŠÄŠ#Ä One-hotÄ encodingÄ ofÄ categoricalÄ variablesÄŠÄŠ#Ä One-hotÄ encodingÄ ofÄ categoricalÄ variabl...
true
5,609
Data_Transform
string_transform
Write Python code to transform the text columns.
ÄŠÄŠ#Ä TransformÄ theÄ textÄ columnsÄŠÄŠ#Ä ConvertÄ theÄ textÄ toÄ lowerÄ caseÄŠtrain_data['text']Ä =Ä train_data['text'].apply(lambdaÄ x:Ä x.lower())ÄŠtest_data['text']Ä =Ä test_data['text'].apply(lambdaÄ x:Ä x.lower())ÄŠÄŠ#Ä RemoveÄ punctuationÄŠimportÄ stringÄŠtrain_data['text']Ä =Ä train_data['text'].apply(lambdaÄ x:Ä ''.join(chÄ forÄ chÄ inÄ xÄ ifÄ chÄ no...
ÄŠÄŠ#Ä TransformÄ theÄ textÄ columnsÄŠÄŠ#Ä ConvertÄ theÄ textÄ toÄ lowerÄ caseÄŠtrain_data['text']Ä =Ä train_data['text'].apply(lambdaÄ x:Ä x.lower())ÄŠtest_data['text']Ä =Ä test_data['text'].apply(lambdaÄ x:Ä x.lower())ÄŠÄŠ#Ä RemoveÄ punctuationÄŠimportÄ stringÄŠtrain_data['text']Ä =Ä train_data['text'].apply(lambdaÄ x:Ä ''.join(chÄ forÄ chÄ inÄ xÄ ifÄ chÄ no...
true
5,601
Data_Transform
split
Write Python code to split the data into training and test sets.
ÄŠÄŠ#Ä SplittingÄ theÄ dataÄ intoÄ trainingÄ andÄ testÄ setsÄŠfromÄ sklearn.model_selectionÄ importÄ train_test_splitÄŠÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠ
ÄŠÄŠ#Ä SplittingÄ theÄ dataÄ intoÄ trainingÄ andÄ testÄ setsÄŠfromÄ sklearn.model_selectionÄ importÄ train_test_splitÄŠÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠ
true
5,833
Data_Transform
correct_missing_values
Write Python code to handle the missing values.
ÄŠÄŠ#Ä FillÄ missingÄ valuesÄ withÄ 0ÄŠtrain_data.fillna(0,Ä inplace=True)ÄŠtest_data.fillna(0,Ä inplace=True)ÄŠ
ÄŠÄŠ#Ä FillÄ missingÄ valuesÄ withÄ 0ÄŠtrain_data.fillna(0,Ä inplace=True)ÄŠtest_data.fillna(0,Ä inplace=True)ÄŠ
true
4,149
Data_Transform
prepare_x_and_y
Write Python code to separate the features and the target.
ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ featuresÄ andÄ targetÄŠXÄ =Ä df.drop('count',Ä axis=1)ÄŠyÄ =Ä df['count']ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ testingÄ setsÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ validationÄ setsÄŠX_train,Ä X_val,Ä y_train,Ä y_valÄ =Ä train_t...
ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ featuresÄ andÄ targetÄŠXÄ =Ä df.drop('count',Ä axis=1)ÄŠyÄ =Ä df['count']ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ testingÄ setsÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ validationÄ setsÄŠX_train,Ä X_val,Ä y_train,Ä y_valÄ =Ä train_t...
true
7,864
Data_Transform
split
Write Python code to split the data into training and test sets.
ÄŠÄŠ#Ä SplittingÄ theÄ dataÄ intoÄ trainingÄ andÄ testÄ setsÄŠfromÄ sklearn.model_selectionÄ importÄ train_test_splitÄŠÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠ
ÄŠÄŠ#Ä SplittingÄ theÄ dataÄ intoÄ trainingÄ andÄ testÄ setsÄŠfromÄ sklearn.model_selectionÄ importÄ train_test_splitÄŠÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠ
true
7,851
Data_Transform
split
Write Python code to split the data into training and test sets.
ÄŠÄŠ#Ä SplittingÄ theÄ dataÄ intoÄ trainingÄ andÄ testÄ setsÄŠfromÄ sklearn.model_selectionÄ importÄ train_test_splitÄŠÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠ
ÄŠÄŠ#Ä SplittingÄ theÄ dataÄ intoÄ trainingÄ andÄ testÄ setsÄŠfromÄ sklearn.model_selectionÄ importÄ train_test_splitÄŠÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠ
true
3,900
Data_Transform
groupby
Write Python code to group and aggregate the data.
ÄŠÄŠ#Ä GroupÄ andÄ aggregateÄ theÄ dataÄŠÄŠ#Ä GroupÄ byÄ dateÄŠgrouped_dataÄ =Ä data.groupby('Date')ÄŠÄŠ#Ä AggregateÄ theÄ dataÄŠgrouped_data_aggÄ =Ä grouped_data.agg({'ConfirmedCases':Ä 'sum',Ä 'Fatalities':Ä 'sum'})ÄŠÄŠ#Ä ResetÄ theÄ indexÄŠgrouped_data_agg.reset_index(inplace=True)ÄŠÄŠ#Ä RenameÄ theÄ columnsÄŠgrouped_data_agg.columnsÄ =Ä ['Date',Ä 'Confirm...
ÄŠÄŠ#Ä GroupÄ andÄ aggregateÄ theÄ dataÄŠÄŠ#Ä GroupÄ byÄ dateÄŠgrouped_dataÄ =Ä data.groupby('Date')ÄŠÄŠ#Ä AggregateÄ theÄ dataÄŠgrouped_data_aggÄ =Ä grouped_data.agg({'ConfirmedCases':Ä 'sum',Ä 'Fatalities':Ä 'sum'})ÄŠÄŠ#Ä ResetÄ theÄ indexÄŠgrouped_data_agg.reset_index(inplace=True)ÄŠÄŠ#Ä RenameÄ theÄ columnsÄŠgrouped_data_agg.columnsÄ =Ä ['Date',Ä 'Confirm...
true
3,981
Data_Transform
rename_columns
Write Python code to rename the columns.
ÄŠÄŠ#Ä CreateÄ aÄ newÄ dataframeÄ withÄ theÄ columnsÄ ofÄ interestÄŠdf_train_selectedÄ =Ä df_train[['datetime',Ä 'count',Ä 'count_1',Ä 'count_2',Ä 'count_3',Ä 'count_4',Ä 'count_5',Ä 'count_6',Ä 'count_7',Ä 'count_8',Ä 'count_9',Ä 'count_10',Ä 'count_11',Ä 'count_12',Ä 'count_13',Ä 'count_14',Ä 'count_15',Ä 'count_16',Ä 'count_17',Ä 'count_18',Ä 'count...
ÄŠÄŠ#Ä CreateÄ aÄ newÄ dataframeÄ withÄ theÄ columnsÄ ofÄ interestÄŠdf_train_selectedÄ =Ä df_train[['datetime',Ä 'count',Ä 'count_1',Ä 'count_2',Ä 'count_3',Ä 'count_4',Ä 'count_5',Ä 'count_6',Ä 'count_7',Ä 'count_8',Ä 'count_9',Ä 'count_10',Ä 'count_11',Ä 'count_12',Ä 'count_13',Ä 'count_14',Ä 'count_15',Ä 'count_16',Ä 'count_17',Ä 'count_18',Ä 'count...
true
54
Data_Transform
filter
Write Python code to filter the rows of the data.
ÄŠÄŠ#Ä FilterÄ theÄ rowsÄ ofÄ theÄ dataÄ basedÄ onÄ theÄ conditionÄŠdata_filteredÄ =Ä data[data['Country_Region']Ä ==Ä 'US']ÄŠÄŠ#Ä CheckÄ theÄ filteredÄ dataÄŠdata_filtered.head()ÄŠ
ÄŠÄŠ#Ä FilterÄ theÄ rowsÄ ofÄ theÄ dataÄ basedÄ onÄ theÄ conditionÄŠdata_filteredÄ =Ä data[data['Country_Region']Ä ==Ä 'US']ÄŠÄŠ#Ä CheckÄ theÄ filteredÄ dataÄŠdata_filtered.head()ÄŠ
true
6,817
Data_Transform
prepare_x_and_y
Write Python code to separate the features and the target.
ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ featuresÄ andÄ targetÄŠXÄ =Ä df.drop('count',Ä axis=1)ÄŠyÄ =Ä df['count']ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ testingÄ setsÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ validationÄ setsÄŠX_train,Ä X_val,Ä y_train,Ä y_valÄ =Ä train_t...
ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ featuresÄ andÄ targetÄŠXÄ =Ä df.drop('count',Ä axis=1)ÄŠyÄ =Ä df['count']ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ testingÄ setsÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ validationÄ setsÄŠX_train,Ä X_val,Ä y_train,Ä y_valÄ =Ä train_t...
true
5,249
Data_Transform
split
Write Python code to split the data into training and test sets.
ÄŠÄŠ#Ä SplittingÄ theÄ dataÄ intoÄ trainingÄ andÄ testÄ setsÄŠfromÄ sklearn.model_selectionÄ importÄ train_test_splitÄŠÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠ
ÄŠÄŠ#Ä SplittingÄ theÄ dataÄ intoÄ trainingÄ andÄ testÄ setsÄŠfromÄ sklearn.model_selectionÄ importÄ train_test_splitÄŠÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠ
true
3,955
Data_Transform
categorify
Write Python code to encode the categorical features.
ÄŠÄŠ#Ä EncodingÄ categoricalÄ featuresÄŠfromÄ sklearn.preprocessingÄ importÄ LabelEncoderÄŠÄŠ#Ä LabelÄ EncodingÄŠleÄ =Ä LabelEncoder()ÄŠÄŠ#Ä CategoricalÄ featuresÄŠcategorical_featuresÄ =Ä ['Gender',Ä 'Married',Ä 'Education',Ä 'Occupation',Ä 'Location',Ä 'Month',Ä 'Country']ÄŠÄŠ#Ä ApplyÄ LabelÄ EncodingÄ toÄ categoricalÄ featuresÄŠforÄ featureÄ inÄ categorica...
ÄŠÄŠ#Ä EncodingÄ categoricalÄ featuresÄŠfromÄ sklearn.preprocessingÄ importÄ LabelEncoderÄŠÄŠ#Ä LabelÄ EncodingÄŠleÄ =Ä LabelEncoder()ÄŠÄŠ#Ä CategoricalÄ featuresÄŠcategorical_featuresÄ =Ä ['Gender',Ä 'Married',Ä 'Education',Ä 'Occupation',Ä 'Location',Ä 'Month',Ä 'Country']ÄŠÄŠ#Ä ApplyÄ LabelÄ EncodingÄ toÄ categoricalÄ featuresÄŠforÄ featureÄ inÄ categorica...
true
2,481
Data_Transform
categorify
Write Python code to encode the categorical features.
ÄŠÄŠ#Ä EncodingÄ categoricalÄ featuresÄŠfromÄ sklearn.preprocessingÄ importÄ LabelEncoderÄŠÄŠ#Ä LabelÄ EncodingÄŠleÄ =Ä LabelEncoder()ÄŠÄŠ#Ä CategoricalÄ featuresÄŠcategorical_featuresÄ =Ä ['Gender',Ä 'Married',Ä 'Education',Ä 'Occupation',Ä 'Location',Ä 'Month',Ä 'Country']ÄŠÄŠ#Ä ApplyÄ LabelÄ EncodingÄ toÄ categoricalÄ featuresÄŠforÄ featureÄ inÄ categorica...
ÄŠÄŠ#Ä EncodingÄ categoricalÄ featuresÄŠfromÄ sklearn.preprocessingÄ importÄ LabelEncoderÄŠÄŠ#Ä LabelÄ EncodingÄŠleÄ =Ä LabelEncoder()ÄŠÄŠ#Ä CategoricalÄ featuresÄŠcategorical_featuresÄ =Ä ['Gender',Ä 'Married',Ä 'Education',Ä 'Occupation',Ä 'Location',Ä 'Month',Ä 'Country']ÄŠÄŠ#Ä ApplyÄ LabelÄ EncodingÄ toÄ categoricalÄ featuresÄŠforÄ featureÄ inÄ categorica...
true
4,932
Data_Transform
feature_engineering
Write Python code to engineer new features.
ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ monthÄŠtrain['month_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.day)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ yearÄŠtrain['year_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.year)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ quarterÄŠtrain['quarter_days'...
ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ monthÄŠtrain['month_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.day)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ yearÄŠtrain['year_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.year)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ quarterÄŠtrain['quarter_days'...
true
5,350
Data_Transform
prepare_x_and_y
Write Python code to separate the features and the target.
ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ featuresÄ andÄ targetÄŠXÄ =Ä df.drop('count',Ä axis=1)ÄŠyÄ =Ä df['count']ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ testingÄ setsÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ validationÄ setsÄŠX_train,Ä X_val,Ä y_train,Ä y_valÄ =Ä train_t...
ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ featuresÄ andÄ targetÄŠXÄ =Ä df.drop('count',Ä axis=1)ÄŠyÄ =Ä df['count']ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ testingÄ setsÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ validationÄ setsÄŠX_train,Ä X_val,Ä y_train,Ä y_valÄ =Ä train_t...
true
2,616
Data_Transform
filter
Write Python code to filter the rows of the data.
ÄŠÄŠ#Ä FilterÄ theÄ rowsÄ ofÄ theÄ dataÄ basedÄ onÄ theÄ conditionÄŠ#Ä ForÄ example,Ä ifÄ weÄ wantÄ toÄ filterÄ theÄ rowsÄ whereÄ theÄ 'A'Ä columnÄ isÄ greaterÄ thanÄ 10ÄŠ#Ä dataÄ =Ä data[data['A']Ä >Ä 10]ÄŠÄŠ#Ä FilterÄ theÄ rowsÄ basedÄ onÄ theÄ conditionÄŠdataÄ =Ä data[data['A']Ä >Ä 10]ÄŠ
ÄŠÄŠ#Ä FilterÄ theÄ rowsÄ ofÄ theÄ dataÄ basedÄ onÄ theÄ conditionÄŠ#Ä ForÄ example,Ä ifÄ weÄ wantÄ toÄ filterÄ theÄ rowsÄ whereÄ theÄ 'A'Ä columnÄ isÄ greaterÄ thanÄ 10ÄŠ#Ä dataÄ =Ä data[data['A']Ä >Ä 10]ÄŠÄŠ#Ä FilterÄ theÄ rowsÄ basedÄ onÄ theÄ conditionÄŠdataÄ =Ä data[data['A']Ä >Ä 10]ÄŠ
true
1,811
Data_Transform
drop_column
Write Python code to drop the unneeded columns.
ÄŠÄŠ#Ä DropÄ theÄ columnsÄ thatÄ areÄ notÄ neededÄŠtrain_dataÄ =Ä train_data.drop(['datetime',Ä 'count'],Ä axis=1)ÄŠtest_dataÄ =Ä test_data.drop(['datetime',Ä 'count'],Ä axis=1)ÄŠ
ÄŠÄŠ#Ä DropÄ theÄ columnsÄ thatÄ areÄ notÄ neededÄŠtrain_dataÄ =Ä train_data.drop(['datetime',Ä 'count'],Ä axis=1)ÄŠtest_dataÄ =Ä test_data.drop(['datetime',Ä 'count'],Ä axis=1)ÄŠ
true
6,927
Data_Transform
data_type_conversions
Write Python code to convert the column data types.
ÄŠÄŠ#Ä ConvertÄ theÄ columnÄ datatypesÄŠtrain_data['datetime']Ä =Ä pd.to_datetime(train_data['datetime'])ÄŠtrain_data['year']Ä =Ä train_data['datetime'].dt.yearÄŠtrain_data['month']Ä =Ä train_data['datetime'].dt.monthÄŠtrain_data['day']Ä =Ä train_data['datetime'].dt.dayÄŠtrain_data['hour']Ä =Ä train_data['datetime'].dt.hourÄŠtrain_data['wee...
ÄŠÄŠ#Ä ConvertÄ theÄ columnÄ datatypesÄŠtrain_data['datetime']Ä =Ä pd.to_datetime(train_data['datetime'])ÄŠtrain_data['year']Ä =Ä train_data['datetime'].dt.yearÄŠtrain_data['month']Ä =Ä train_data['datetime'].dt.monthÄŠtrain_data['day']Ä =Ä train_data['datetime'].dt.dayÄŠtrain_data['hour']Ä =Ä train_data['datetime'].dt.hourÄŠtrain_data['wee...
true
3,938
Data_Transform
data_type_conversions
Write Python code to convert the column data types.
ÄŠÄŠ#Ä ConvertÄ theÄ columnÄ datatypesÄŠtrain_data['datetime']Ä =Ä pd.to_datetime(train_data['datetime'])ÄŠtrain_data['year']Ä =Ä train_data['datetime'].dt.yearÄŠtrain_data['month']Ä =Ä train_data['datetime'].dt.monthÄŠtrain_data['day']Ä =Ä train_data['datetime'].dt.dayÄŠtrain_data['hour']Ä =Ä train_data['datetime'].dt.hourÄŠtrain_data['wee...
ÄŠÄŠ#Ä ConvertÄ theÄ columnÄ datatypesÄŠtrain_data['datetime']Ä =Ä pd.to_datetime(train_data['datetime'])ÄŠtrain_data['year']Ä =Ä train_data['datetime'].dt.yearÄŠtrain_data['month']Ä =Ä train_data['datetime'].dt.monthÄŠtrain_data['day']Ä =Ä train_data['datetime'].dt.dayÄŠtrain_data['hour']Ä =Ä train_data['datetime'].dt.hourÄŠtrain_data['wee...
true
5,230
Data_Transform
merge
Write Python code to merge the datasets.
ÄŠÄŠ#Ä ImportingÄ necessaryÄ librariesÄŠimportÄ pandasÄ asÄ pdÄŠimportÄ numpyÄ asÄ npÄŠÄŠ#Ä LoadingÄ theÄ datasetsÄŠtrain_dataÄ =Ä pd.read_csv('../input/train.csv')ÄŠtest_dataÄ =Ä pd.read_csv('../input/test.csv')ÄŠÄŠ#Ä CheckingÄ theÄ shapeÄ ofÄ theÄ datasetsÄŠprint(train_data.shape)ÄŠprint(test_data.shape)ÄŠÄŠ#Ä CheckingÄ theÄ firstÄ 5Ä rowsÄ ofÄ theÄ datasetsÄŠp...
ÄŠÄŠ#Ä ImportingÄ necessaryÄ librariesÄŠimportÄ pandasÄ asÄ pdÄŠimportÄ numpyÄ asÄ npÄŠÄŠ#Ä LoadingÄ theÄ datasetsÄŠtrain_dataÄ =Ä pd.read_csv('../input/train.csv')ÄŠtest_dataÄ =Ä pd.read_csv('../input/test.csv')ÄŠÄŠ#Ä CheckingÄ theÄ shapeÄ ofÄ theÄ datasetsÄŠprint(train_data.shape)ÄŠprint(test_data.shape)ÄŠÄŠ#Ä CheckingÄ theÄ firstÄ 5Ä rowsÄ ofÄ theÄ datasetsÄŠp...
true
4,222
Data_Transform
feature_engineering
Write Python code to engineer new features.
ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ monthÄŠtrain['month_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.day)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ yearÄŠtrain['year_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.year)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ quarterÄŠtrain['quarter_days'...
ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ monthÄŠtrain['month_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.day)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ yearÄŠtrain['year_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.year)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ quarterÄŠtrain['quarter_days'...
true
5,266
Data_Transform
categorify
Write Python code to encode the categorical features.
ÄŠÄŠ#Ä EncodingÄ categoricalÄ featuresÄŠÄŠ#Ä ConvertÄ categoricalÄ variablesÄ toÄ numericÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#...
ÄŠÄŠ#Ä EncodingÄ categoricalÄ featuresÄŠÄŠ#Ä ConvertÄ categoricalÄ variablesÄ toÄ numericÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#...
true
4,050
Data_Transform
feature_engineering
Write Python code to engineer new features.
ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ monthÄŠtrain['month_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.day)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ yearÄŠtrain['year_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.year)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ quarterÄŠtrain['quarter_days'...
ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ monthÄŠtrain['month_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.day)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ yearÄŠtrain['year_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.year)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ quarterÄŠtrain['quarter_days'...
true
6,331
Data_Transform
correct_missing_values
Write Python code to handle the missing values.
ÄŠÄŠ#Ä FillÄ missingÄ valuesÄ withÄ 0ÄŠtrain_data.fillna(0,Ä inplace=True)ÄŠtest_data.fillna(0,Ä inplace=True)ÄŠ
ÄŠÄŠ#Ä FillÄ missingÄ valuesÄ withÄ 0ÄŠtrain_data.fillna(0,Ä inplace=True)ÄŠtest_data.fillna(0,Ä inplace=True)ÄŠ
true
3,954
Data_Transform
drop_column
Write Python code to drop the unneeded columns.
ÄŠÄŠ#Ä DropÄ theÄ columnsÄ thatÄ areÄ notÄ neededÄŠtrain_dataÄ =Ä train_data.drop(['datetime',Ä 'count'],Ä axis=1)ÄŠtest_dataÄ =Ä test_data.drop(['datetime',Ä 'count'],Ä axis=1)ÄŠ
ÄŠÄŠ#Ä DropÄ theÄ columnsÄ thatÄ areÄ notÄ neededÄŠtrain_dataÄ =Ä train_data.drop(['datetime',Ä 'count'],Ä axis=1)ÄŠtest_dataÄ =Ä test_data.drop(['datetime',Ä 'count'],Ä axis=1)ÄŠ
true
1,801
Data_Transform
merge
Write Python code to merge the datasets.
ÄŠÄŠ#Ä ImportingÄ necessaryÄ librariesÄŠimportÄ pandasÄ asÄ pdÄŠimportÄ numpyÄ asÄ npÄŠÄŠ#Ä LoadingÄ theÄ datasetsÄŠtrain_dataÄ =Ä pd.read_csv('../input/train.csv')ÄŠtest_dataÄ =Ä pd.read_csv('../input/test.csv')ÄŠÄŠ#Ä CheckingÄ theÄ shapeÄ ofÄ theÄ datasetsÄŠprint(train_data.shape)ÄŠprint(test_data.shape)ÄŠÄŠ#Ä CheckingÄ theÄ firstÄ 5Ä rowsÄ ofÄ theÄ datasetsÄŠp...
ÄŠÄŠ#Ä ImportingÄ necessaryÄ librariesÄŠimportÄ pandasÄ asÄ pdÄŠimportÄ numpyÄ asÄ npÄŠÄŠ#Ä LoadingÄ theÄ datasetsÄŠtrain_dataÄ =Ä pd.read_csv('../input/train.csv')ÄŠtest_dataÄ =Ä pd.read_csv('../input/test.csv')ÄŠÄŠ#Ä CheckingÄ theÄ shapeÄ ofÄ theÄ datasetsÄŠprint(train_data.shape)ÄŠprint(test_data.shape)ÄŠÄŠ#Ä CheckingÄ theÄ firstÄ 5Ä rowsÄ ofÄ theÄ datasetsÄŠp...
true
7,901
Data_Transform
prepare_x_and_y
Write Python code to separate the features and the target.
ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ featuresÄ andÄ targetÄŠXÄ =Ä df.drop('count',Ä axis=1)ÄŠyÄ =Ä df['count']ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ testingÄ setsÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ validationÄ setsÄŠX_train,Ä X_val,Ä y_train,Ä y_valÄ =Ä train_t...
ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ featuresÄ andÄ targetÄŠXÄ =Ä df.drop('count',Ä axis=1)ÄŠyÄ =Ä df['count']ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ testingÄ setsÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ validationÄ setsÄŠX_train,Ä X_val,Ä y_train,Ä y_valÄ =Ä train_t...
true
4,258
Data_Transform
feature_engineering
Write Python code to engineer new features.
ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ monthÄŠtrain['month_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.day)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ yearÄŠtrain['year_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.year)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ quarterÄŠtrain['quarter_days'...
ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ monthÄŠtrain['month_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.day)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ yearÄŠtrain['year_days']Ä =Ä train['date'].apply(lambdaÄ x:Ä x.year)ÄŠÄŠ#Ä CreateÄ aÄ newÄ featureÄ forÄ theÄ numberÄ ofÄ daysÄ inÄ theÄ quarterÄŠtrain['quarter_days'...
true
1,113
Data_Transform
concatenate
Write Python code to concatenate the datasets.
ÄŠÄŠ#Ä ConcatenateÄ theÄ datasetsÄŠtrain_dataÄ =Ä pd.concat([train_data,Ä test_data],Ä axis=0)ÄŠtrain_data.head()ÄŠ
ÄŠÄŠ#Ä ConcatenateÄ theÄ datasetsÄŠtrain_dataÄ =Ä pd.concat([train_data,Ä test_data],Ä axis=0)ÄŠtrain_data.head()ÄŠ
true
5,486
Data_Transform
split
Write Python code to split the data into training and test sets.
ÄŠÄŠ#Ä SplittingÄ theÄ dataÄ intoÄ trainingÄ andÄ testÄ setsÄŠfromÄ sklearn.model_selectionÄ importÄ train_test_splitÄŠÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠ
ÄŠÄŠ#Ä SplittingÄ theÄ dataÄ intoÄ trainingÄ andÄ testÄ setsÄŠfromÄ sklearn.model_selectionÄ importÄ train_test_splitÄŠÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠ
true
4,622
Data_Transform
prepare_x_and_y
Write Python code to separate the features and the target.
ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ featuresÄ andÄ targetÄŠXÄ =Ä df.drop('count',Ä axis=1)ÄŠyÄ =Ä df['count']ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ testingÄ setsÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ validationÄ setsÄŠX_train,Ä X_val,Ä y_train,Ä y_valÄ =Ä train_t...
ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ featuresÄ andÄ targetÄŠXÄ =Ä df.drop('count',Ä axis=1)ÄŠyÄ =Ä df['count']ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ testingÄ setsÄŠX_train,Ä X_test,Ä y_train,Ä y_testÄ =Ä train_test_split(X,Ä y,Ä test_size=0.2,Ä random_state=42)ÄŠÄŠ#Ä SplitÄ theÄ dataÄ intoÄ trainingÄ andÄ validationÄ setsÄŠX_train,Ä X_val,Ä y_train,Ä y_valÄ =Ä train_t...
true
2,640
Data_Transform
categorify
Write Python code to encode the categorical features.
ÄŠÄŠ#Ä EncodingÄ categoricalÄ featuresÄŠfromÄ sklearn.preprocessingÄ importÄ LabelEncoderÄŠÄŠ#Ä LabelÄ EncodingÄŠleÄ =Ä LabelEncoder()ÄŠÄŠ#Ä CategoricalÄ featuresÄŠcategorical_featuresÄ =Ä ['Gender',Ä 'Married',Ä 'Education',Ä 'Occupation',Ä 'Location',Ä 'Month',Ä 'Country']ÄŠÄŠ#Ä ApplyÄ LabelÄ EncodingÄ toÄ categoricalÄ featuresÄŠforÄ featureÄ inÄ categorica...
ÄŠÄŠ#Ä EncodingÄ categoricalÄ featuresÄŠfromÄ sklearn.preprocessingÄ importÄ LabelEncoderÄŠÄŠ#Ä LabelÄ EncodingÄŠleÄ =Ä LabelEncoder()ÄŠÄŠ#Ä CategoricalÄ featuresÄŠcategorical_featuresÄ =Ä ['Gender',Ä 'Married',Ä 'Education',Ä 'Occupation',Ä 'Location',Ä 'Month',Ä 'Country']ÄŠÄŠ#Ä ApplyÄ LabelÄ EncodingÄ toÄ categoricalÄ featuresÄŠforÄ featureÄ inÄ categorica...
true
6,574
Data_Transform
drop_column
Write Python code to drop the unneeded columns.
ÄŠÄŠ#Ä DropÄ theÄ columnsÄ thatÄ areÄ notÄ neededÄŠtrain_dataÄ =Ä train_data.drop(['datetime',Ä 'count'],Ä axis=1)ÄŠtest_dataÄ =Ä test_data.drop(['datetime',Ä 'count'],Ä axis=1)ÄŠ
ÄŠÄŠ#Ä DropÄ theÄ columnsÄ thatÄ areÄ notÄ neededÄŠtrain_dataÄ =Ä train_data.drop(['datetime',Ä 'count'],Ä axis=1)ÄŠtest_dataÄ =Ä test_data.drop(['datetime',Ä 'count'],Ä axis=1)ÄŠ
true
6,459
Data_Transform
create_dataframe
Write Python code to create a DataFrame.
ÄŠÄŠ#Ä CreateÄ aÄ DataFrameÄŠdfÄ =Ä pd.DataFrame(data={'A':Ä [1,Ä 2,Ä 3,Ä 4,Ä 5],Ä 'B':Ä [10,Ä 20,Ä 30,Ä 40,Ä 50]})ÄŠprint(df)ÄŠ
ÄŠÄŠ#Ä CreateÄ aÄ DataFrameÄŠdfÄ =Ä pd.DataFrame(data={'A':Ä [1,Ä 2,Ä 3,Ä 4,Ä 5],Ä 'B':Ä [10,Ä 20,Ä 30,Ä 40,Ä 50]})ÄŠprint(df)ÄŠ
true
153
Data_Transform
groupby
Write Python code to group and aggregate the data.
ÄŠÄŠ#Ä GroupÄ andÄ aggregateÄ theÄ dataÄŠÄŠ#Ä GroupÄ byÄ dateÄŠgrouped_dataÄ =Ä data.groupby('Date')ÄŠÄŠ#Ä AggregateÄ theÄ dataÄŠgrouped_data_aggÄ =Ä grouped_data.agg({'ConfirmedCases':Ä 'sum',Ä 'Fatalities':Ä 'sum'})ÄŠÄŠ#Ä ResetÄ theÄ indexÄŠgrouped_data_agg.reset_index(inplace=True)ÄŠÄŠ#Ä RenameÄ theÄ columnsÄŠgrouped_data_agg.columnsÄ =Ä ['Date',Ä 'Confirm...
ÄŠÄŠ#Ä GroupÄ andÄ aggregateÄ theÄ dataÄŠÄŠ#Ä GroupÄ byÄ dateÄŠgrouped_dataÄ =Ä data.groupby('Date')ÄŠÄŠ#Ä AggregateÄ theÄ dataÄŠgrouped_data_aggÄ =Ä grouped_data.agg({'ConfirmedCases':Ä 'sum',Ä 'Fatalities':Ä 'sum'})ÄŠÄŠ#Ä ResetÄ theÄ indexÄŠgrouped_data_agg.reset_index(inplace=True)ÄŠÄŠ#Ä RenameÄ theÄ columnsÄŠgrouped_data_agg.columnsÄ =Ä ['Date',Ä 'Confirm...
true
7,419
Data_Transform
create_dataframe
Write Python code to create a DataFrame.
ÄŠÄŠ#Ä CreateÄ aÄ DataFrameÄŠdfÄ =Ä pd.DataFrame(data={'A':Ä [1,Ä 2,Ä 3,Ä 4,Ä 5],Ä 'B':Ä [10,Ä 20,Ä 30,Ä 40,Ä 50]})ÄŠprint(df)ÄŠ
ÄŠÄŠ#Ä CreateÄ aÄ DataFrameÄŠdfÄ =Ä pd.DataFrame(data={'A':Ä [1,Ä 2,Ä 3,Ä 4,Ä 5],Ä 'B':Ä [10,Ä 20,Ä 30,Ä 40,Ä 50]})ÄŠprint(df)ÄŠ
true
815
Data_Transform
concatenate
Write Python code to concatenate the datasets.
ÄŠÄŠ#Ä ConcatenateÄ theÄ datasetsÄŠtrain_dataÄ =Ä pd.concat([train_data,Ä test_data],Ä axis=0)ÄŠtrain_data.head()ÄŠ
ÄŠÄŠ#Ä ConcatenateÄ theÄ datasetsÄŠtrain_dataÄ =Ä pd.concat([train_data,Ä test_data],Ä axis=0)ÄŠtrain_data.head()ÄŠ
true
3,597
Data_Transform
drop_column
Write Python code to drop the unneeded columns.
ÄŠÄŠ#Ä DropÄ theÄ columnsÄ thatÄ areÄ notÄ neededÄŠtrain_dataÄ =Ä train_data.drop(['datetime',Ä 'count'],Ä axis=1)ÄŠtest_dataÄ =Ä test_data.drop(['datetime',Ä 'count'],Ä axis=1)ÄŠ
ÄŠÄŠ#Ä DropÄ theÄ columnsÄ thatÄ areÄ notÄ neededÄŠtrain_dataÄ =Ä train_data.drop(['datetime',Ä 'count'],Ä axis=1)ÄŠtest_dataÄ =Ä test_data.drop(['datetime',Ä 'count'],Ä axis=1)ÄŠ
true
2,587
Data_Transform
create_dataframe
Write Python code to create a DataFrame.
ÄŠÄŠ#Ä CreateÄ aÄ DataFrameÄŠdfÄ =Ä pd.DataFrame(data={'A':Ä [1,Ä 2,Ä 3,Ä 4,Ä 5],Ä 'B':Ä [10,Ä 20,Ä 30,Ä 40,Ä 50]})ÄŠprint(df)ÄŠ
ÄŠÄŠ#Ä CreateÄ aÄ DataFrameÄŠdfÄ =Ä pd.DataFrame(data={'A':Ä [1,Ä 2,Ä 3,Ä 4,Ä 5],Ä 'B':Ä [10,Ä 20,Ä 30,Ä 40,Ä 50]})ÄŠprint(df)ÄŠ
true
7,356
Data_Transform
create_dataframe
Write Python code to create a DataFrame.
ÄŠÄŠ#Ä CreateÄ aÄ DataFrameÄŠdfÄ =Ä pd.DataFrame(data={'A':Ä [1,Ä 2,Ä 3,Ä 4,Ä 5],Ä 'B':Ä [10,Ä 20,Ä 30,Ä 40,Ä 50]})ÄŠprint(df)ÄŠ
ÄŠÄŠ#Ä CreateÄ aÄ DataFrameÄŠdfÄ =Ä pd.DataFrame(data={'A':Ä [1,Ä 2,Ä 3,Ä 4,Ä 5],Ä 'B':Ä [10,Ä 20,Ä 30,Ä 40,Ä 50]})ÄŠprint(df)ÄŠ
true
5,022
Data_Transform
categorify
Write Python code to encode the categorical features.
ÄŠÄŠ#Ä EncodingÄ categoricalÄ featuresÄŠÄŠ#Ä ConvertÄ categoricalÄ variablesÄ toÄ numericÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#Ä One-hotÄ encodingÄ ofÄ categoricalÄ variablesÄŠÄŠ#Ä One-hotÄ encodingÄ ofÄ categoricalÄ variablesÄŠÄŠ#Ä One-hotÄ encodingÄ ofÄ categoricalÄ variablesÄŠÄŠ#Ä One-hotÄ encodingÄ ofÄ categoricalÄ variablesÄŠÄŠ#Ä One-hotÄ encodingÄ ofÄ categoricalÄ variabl...
ÄŠÄŠ#Ä EncodingÄ categoricalÄ featuresÄŠÄŠ#Ä ConvertÄ categoricalÄ variablesÄ toÄ numericÄŠÄŠ#Ä One-hotÄ encodingÄŠÄŠ#Ä One-hotÄ encodingÄ ofÄ categoricalÄ variablesÄŠÄŠ#Ä One-hotÄ encodingÄ ofÄ categoricalÄ variablesÄŠÄŠ#Ä One-hotÄ encodingÄ ofÄ categoricalÄ variablesÄŠÄŠ#Ä One-hotÄ encodingÄ ofÄ categoricalÄ variablesÄŠÄŠ#Ä One-hotÄ encodingÄ ofÄ categoricalÄ variabl...
true
End of preview.

No dataset card yet

Downloads last month
719