<jupyter_start><jupyter_text>Import the dataRead from the CSV fileAssign it to a variable(by the way, do you think 'dataset' is a good variable name?)<jupyter_code>dataset = pd.read_csv('resources/data/train.csv')<jupyter_output><empty_output><jupyter_text>Basic examination of the data<jupyter_code>type(dataset)
dataset.head(10) # Prints first 10 entries of the dataset
dataset.shape # Shows number of rows and columns
dataset.dtypes # Shows datatypes of each column
dataset.describe(include='all')<jupyter_output><empty_output><jupyter_text>Write the dataframe to another CSV file<jupyter_code>dataset.to_csv(r'resources/saveddata/titanic.csv')<jupyter_output><empty_output><jupyter_text>Importing .py files You can import your own Python scripts the same way you import modules like Pandas.<jupyter_code># We'll need this in a second!
import resources
import my_script
import my_script
import my_functions as mf
mf.add_50(23)
mf.multiply_2()<jupyter_output><empty_output><jupyter_text>Here's the code that will work in this case:<jupyter_code>resources.add_50(23)
resources.multiply_2()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08928571428571429, 'fraction_numerical': 0.0125, 'mean_word_length': 8.264462809917354, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '310873', 'license': 'Apache-2.0', 'n_tokens_mistral': 384, 'n_tokens_neox': 372, 'n_words': 99, 'path': 'lesson02/lecture/pandas_csv_read_write.ipynb', 'repo_name': 'ember-b-Moss/redi-da-cph-spring21', 'size': '1120'}