<jupyter_start><jupyter_text>Open Source Development - Assignment 2Click here for better notebook render. **Open Source Project: *pandas - Python Data Analysis Library (https://github.com/pandas-dev/pandas)*****Initial Proposal - Proposed Enhancements:**1. `read_csv()` function - add a pop-up GUI for the user to select the .csv file to be imported, increased convenience when files are located in another directory. [*[LINK]*](feature1)2. `to_csv()` function - add a pop-up GUI for the user to export their existing dataframe into a .csv file, increased convenience when the user wants to save the file in another directory as the user need not change directories via code or copy/paste the exported file. [*[LINK]*](feature2)3. `DataFrame.dropna()` function - add a function parameter to also drop columns/rows (depending on the selected axis) containing infinity values, instead of purely columns/rows containing NaN values. [*[LINK]*](feature3)Dataset Source: https://www.kaggle.com/agirlcoding/all-space-missions-from-1957 *Check current Conda environment and import necessary libraries (for installation and for the project).*<jupyter_code>import sys
print("Conda environment directory:", sys.executable)

import os<jupyter_output>Conda environment directory: C:\Users\Michael\Anaconda3\envs\OSD\python.exe<jupyter_text>*Install pandas (original library) using pip.*<jupyter_code>!pip3 install pandas<jupyter_output><empty_output><jupyter_text>*Install pandas (modified library).*<jupyter_code>library_path = "pandas-gh-repo"

current_path = os.getcwd()
os.chdir(library_path)
!python setup.py build_ext --inplace
!python setup.py install
os.chdir(current_path)<jupyter_output><empty_output><jupyter_text>*Uninstall pandas using pip.*<jupyter_code>!pip3 uninstall pandas --yes<jupyter_output><empty_output><jupyter_text>*Import pandas and check version. If pandas is not installed, ModuleNotFoundError will be raised.*<jupyter_code>import pandas as pd
print("pandas:", pd.__version__)<jupyter_output>pandas: 0+unknown<jupyter_text>Feature Enhancement 1: pandas.read_csv() **Original**<jupyter_code>df1_original = pd.read_csv("E:\Desktop\PSB\- CU\Term 4 - 27Jul20 to 30Oct20\OSD\Assignment2\Space_Corrected.csv")
df1_original
df2_original = pd.read_csv("E:\Desktop\PSB\- CU\Term 4 - 27Jul20 to 30Oct20\OSD\Assignment2\Testing\initial.csv", 
                           sep = '/',
                           header = [0, 1])
df2_original<jupyter_output><empty_output><jupyter_text>**Modified**<jupyter_code>df1_modified = pd.read_csv(gui=True)
df1_modified
df2_modified = pd.read_csv(gui=True)
df2_modified<jupyter_output><empty_output><jupyter_text>**Verification**<jupyter_code>df1_original.equals(df1_modified)
df2_original.equals(df2_modified)<jupyter_output><empty_output><jupyter_text>Feature Enhancement 2: pandas.DataFrame.to_csv() **Original**<jupyter_code>df1_modified.to_csv("df1_modified.csv")
df2_modified.to_csv("df2_modified.csv", sep = '!', header = ['Letter', 'Num'], index = False, encoding = 'utf-16')<jupyter_output><empty_output><jupyter_text>**Modified**<jupyter_code>df1_modified.to_csv(gui=True)
df2_modified.to_csv(gui=True)<jupyter_output>Filepath: E:/Desktop/PSB/- CU/Term 4 - 27Jul20 to 30Oct20/OSD/Assignment2/Testing/df2_modified_x.csv
Syntax: DataFrame.to_csv("E:/Desktop/PSB/- CU/Term 4 - 27Jul20 to 30Oct20/OSD/Assignment2/Testing/df2_modified_x.csv", sep='!', header=['Letter', 'Num'], index=False, encoding='utf-16')<jupyter_text>**Verification**<jupyter_code>pd.read_csv("df1_modified.csv").equals(pd.read_csv("df1_modified_x.csv"))
pd.read_csv("df2_modified.csv", sep = '!', encoding = 'utf-16').equals(pd.read_csv("df2_modified_x.csv", sep = '!', encoding = 'utf-16'))<jupyter_output><empty_output><jupyter_text>Feature Enhancement 3: pandas.DataFrame.dropna() **Original**<jupyter_code>df2_original
df2_original.dropna()<jupyter_output><empty_output><jupyter_text>**Modified**<jupyter_code>df2_original.dropna(dropinf=True)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1313813813813814, 'fraction_numerical': 0.023773773773773772, 'mean_word_length': 7.074747474747475, 'pattern_counts': {'":': 0, '<': 50, '<?xml version=': 0, '>': 50, 'https://': 2, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '13', 'dir': 'jupyter-structured-clean-dedup', 'id': '306095', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 1452, 'n_tokens_neox': 1353, 'n_words': 267, 'path': 'OSD/OSD_A2_Testing.ipynb', 'repo_name': 'xsrm/pandas', 'size': '3996'}