CoolFace
Datasetpublic

23ws-LLMcoder/LLMcoder-GitHub-Python-Mix-Direct

Dataset Card for LLMcoder-GitHub-Python-Mix-Direct Python target autocomplete suggestions in the format of conversations for OpenAI's fine-tuning. Dataset Details Dataset Description Curated by: [More Information Needed] Funded by [optional]: [More Information Needed] Shared by [optional]: [More Information Needed] Language(s) (NLP): [More Information Needed] License: [More Information Needed] Dataset Sources [optional] The data… See the full description on the dataset page: https://huggingface.co/datasets/23ws-LLMcoder/LLMcoder-GitHub-Python-Mix-Direct.

sourceHugging Faceupdated 3y agoView on Hugging Face
0likes216downloads
input.txt50 linesDownload Raw Back to pair_21
1m most common place2if len(train_df.Embarked[ train_df.Embarked.isnull() ]) > 0:3    train_df.Embarked[ train_df.Embarked.isnull() ] = train_df.Embarked.dropna().mode().values4 5Ports = list(enumerate(np.unique(train_df['Embarked'])))    # determine all values of Embarked,6Ports_dict = { name : i for i, name in Ports }              # set up a dictionary in the form  Ports : index7train_df.Embarked = train_df.Embarked.map( lambda x: Ports_dict[x]).astype(int)     # Convert all Embark strings to int8 9# All the ages with no data -> make the median of all Ages10median_age = train_df['Age'].dropna().median()11if len(train_df.Age[ train_df.Age.isnull() ]) > 0:12    train_df.loc[ (train_df.Age.isnull()), 'Age'] = median_age13 14# Remove the Name column, Cabin, Ticket, and Sex (since I copied and filled it to Gender)15train_df = train_df.drop(['Name', 'Sex', 'Ticket', 'Cabin', 'PassengerId'], axis=1) 16 17 18# TEST DATA19test_df = pd.read_csv('test.csv', header=0)        # Load the test file into a dataframe20 21# I need to do the same with the test data now, so that the columns are the same as the training data22# I need to convert all strings to integer classifiers:23# female = 0, Male = 124test_df['Gender'] = test_df['Sex'].map( {'female': 0, 'male': 1} ).astype(int)25 26# Embarked from 'C', 'Q', 'S'27# All missing Embarked -> just make them embark from most common place28if len(test_df.Embarked[ test_df.Embarked.isnull() ]) > 0:29    test_df.Embarked[ test_df.Embarked.isnull() ] = test_df.Embarked.dropna().mode().values30# Again convert all Embarked strings to int31test_df.Embarked = test_df.Embarked.map( lambda x: Ports_dict[x]).astype(int)32 33 34# All the ages with no data -> make the median of all Ages35median_age = test_df['Age'].dropna().median()36if len(test_df.Age[ test_df.Age.isnull() ]) > 0:37    test_df.loc[ (test_df.Age.isnull()), 'Age'] = median_age38 39# All the missing Fares -> assume median of their respective class40if len(test_df.Fare[ test_df.Fare.isnull() ]) > 0:41    median_fare = np.zeros(3)42    for f in range(0,3):                                              # loop 0 to 243        median_fare[f] = test_df[ test_df.Pclass == f+1 ]['Fare'].dropna().median()44    for f in range(0,3):                                              # loop 0 to 245        test_df.loc[ (test_df.Fare.isnull()) & (test_df.Pclass == f+1 ), 'Fare'] = median_fare[f]46 47# Collect the test data's PassengerIds before dropping it48ids = test_df['PassengerId'].values49# Remove the Name column, Cabin, Ticket, and Sex (since I copied and filled it to Gender)50test_df = test_df.drop(['Name', 'Sex', 'Ticket', 'Cabin', 'Passen