diff --git a/.ipynb_checkpoints/Untitled1-checkpoint.ipynb b/.ipynb_checkpoints/Untitled1-checkpoint.ipynb new file mode 100644 index 0000000..2fd6442 --- /dev/null +++ b/.ipynb_checkpoints/Untitled1-checkpoint.ipynb @@ -0,0 +1,6 @@ +{ + "cells": [], + "metadata": {}, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/DataFrame_Groupby.py b/DataFrame_Groupby.py index 19e2346..0928014 100644 --- a/DataFrame_Groupby.py +++ b/DataFrame_Groupby.py @@ -1,5 +1,11 @@ -# -*- coding: utf-8 -*- -__author__ = 'Who ?' +"* -*- coding: utf-8 -*-" + +<<<<<<< HEAD +"__message to author__ = 'solvethisconflict!'" +======= +__author__ = 'Antoine' +#Stop messing with my name +>>>>>>> origin import pandas as pd import numpy as np @@ -24,7 +30,7 @@ def cloneDF(df): - return pd.DataFrame(df.values.copy(), df.index.copy(), df.columns.copy()).convert_objects(convert_numeric=True) + return pd.DataFrame(df.values.copy(), df.index.copy(), df.columns.copy()).apply(pd.to_numeric, errors='coerce') # Show Films with more votes. (groupby + sorted) diff --git a/DataFrame_pivot_table.py b/DataFrame_pivot_table.py index 16b2570..279a81f 100644 --- a/DataFrame_pivot_table.py +++ b/DataFrame_pivot_table.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -__author__ = 'Who ?' +__author__ = 'KwangilChi' import pandas as pd import numpy as np diff --git a/Example_MovieLens.py b/Example_MovieLens.py index 3f26fdb..349a095 100644 --- a/Example_MovieLens.py +++ b/Example_MovieLens.py @@ -1,6 +1,8 @@ # -*- coding: utf-8 -*- __author__ = 'Who ?' +author == Solange + import pandas as pd # Load users info diff --git a/Series_vs_DataFrame.py b/Series_vs_DataFrame.py index a81cb51..c096ddc 100644 --- a/Series_vs_DataFrame.py +++ b/Series_vs_DataFrame.py @@ -1,5 +1,6 @@ + # -*- coding: utf-8 -*- -__author__ = 'Who ?' +__author__ = 'Eugénie' import pandas as pd diff --git a/Untitled.ipynb b/Untitled.ipynb new file mode 100644 index 0000000..2408977 --- /dev/null +++ b/Untitled.ipynb @@ -0,0 +1,89 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 5, + "metadata": {}, + "outputs": [ + { + "ename": "ModuleNotFoundError", + "evalue": "No module named 'DataFrame_Groupby'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32mimport\u001b[0m \u001b[0mDataFrame_Groupby\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'DataFrame_Groupby'" + ] + } + ], + "source": [ + "import DataFrame_Groupby \n", + "\n" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.4" + }, + "toc": { + "base_numbering": 1, + "nav_menu": {}, + "number_sections": true, + "sideBar": true, + "skip_h1_title": false, + "title_cell": "Table of Contents", + "title_sidebar": "Contents", + "toc_cell": false, + "toc_position": {}, + "toc_section_display": true, + "toc_window_display": false + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/Untitled1.ipynb b/Untitled1.ipynb new file mode 100644 index 0000000..ba70147 --- /dev/null +++ b/Untitled1.ipynb @@ -0,0 +1,150 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 4, + "metadata": {}, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Films with more votes: \n", + "Series([], dtype: int64)\n", + "\n", + "==================================================================\n", + "\n", + "Avg ratings: \n", + "Series([], Name: rating, dtype: int64)\n", + "\n", + "==================================================================\n", + "\n", + "Films ratings info: \n", + "Empty DataFrame\n", + "Columns: [mean, sum, count, std]\n", + "Index: []\n", + "\n", + "==================================================================\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/campus14/Documents/Git/4_collaborer/Example_Pandas/DataFrame_Groupby.py:57: FutureWarning: using a dict on a Series for aggregation\n", + "is deprecated and will be removed in a future version. Use named aggregation instead.\n", + "\n", + " >>> grouper.agg(name_1=func_1, name_2=func_2)\n", + "\n", + " {'SUM': np.sum, 'COUNT': np.size, 'AVG': np.mean, 'myAVG': lambda x: x.sum() / float(x.count())})\n" + ] + }, + { + "name": "stdout", + "output_type": "stream", + "text": [ + "My info ratings: \n", + "Empty DataFrame\n", + "Columns: [SUM, COUNT, AVG, myAVG]\n", + "Index: []\n", + "\n", + "==================================================================\n", + "\n" + ] + }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "/home/campus14/Documents/Git/4_collaborer/Example_Pandas/DataFrame_Groupby.py:65: FutureWarning: using a dict on a Series for aggregation\n", + "is deprecated and will be removed in a future version. Use named aggregation instead.\n", + "\n", + " >>> grouper.agg(name_1=func_1, name_2=func_2)\n", + "\n", + " {'COUNT': np.size, 'myAVG': lambda x: x.sum() / float(x.count())}).sort_values('COUNT', ascending=False)\n" + ] + }, + { + "ename": "AttributeError", + "evalue": "'DataFrame' object has no attribute 'sort'", + "output_type": "error", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0;32mfrom\u001b[0m \u001b[0mDataFrame_Groupby\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", + "\u001b[0;32m~/Documents/Git/4_collaborer/Example_Pandas/DataFrame_Groupby.py\u001b[0m in \u001b[0;36m\u001b[0;34m\u001b[0m\n\u001b[1;32m 63\u001b[0m \u001b[0msortRatingsField\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcloneDF\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mmergeRatings\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 64\u001b[0m sortRatingsField = sortRatingsField.groupby(['movie_id', 'title'])['rating'].agg(\n\u001b[0;32m---> 65\u001b[0;31m {'COUNT': np.size, 'myAVG': lambda x: x.sum() / float(x.count())}).sort('COUNT', ascending=False)\n\u001b[0m\u001b[1;32m 66\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'My info sorted: \\n%s'\u001b[0m \u001b[0;34m%\u001b[0m \u001b[0msortRatingsField\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;36m15\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;32m~/anaconda3/lib/python3.7/site-packages/pandas/core/generic.py\u001b[0m in \u001b[0;36m__getattr__\u001b[0;34m(self, name)\u001b[0m\n\u001b[1;32m 5177\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_info_axis\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_can_hold_identifiers_and_holds_name\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5178\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mname\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 5179\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mobject\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__getattribute__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mname\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 5180\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5181\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__setattr__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mname\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvalue\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mAttributeError\u001b[0m: 'DataFrame' object has no attribute 'sort'" + ] + } + ], + "source": [ + "from DataFrame_Groupby import *" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.7.4" + }, + "toc": { + "base_numbering": 1, + "nav_menu": {}, + "number_sections": true, + "sideBar": true, + "skip_h1_title": false, + "title_cell": "Table of Contents", + "title_sidebar": "Contents", + "toc_cell": false, + "toc_position": {}, + "toc_section_display": true, + "toc_window_display": false + }, + "varInspector": { + "cols": { + "lenName": 16, + "lenType": 16, + "lenVar": 40 + }, + "kernels_config": { + "python": { + "delete_cmd_postfix": "", + "delete_cmd_prefix": "del ", + "library": "var_list.py", + "varRefreshCmd": "print(var_dic_list())" + }, + "r": { + "delete_cmd_postfix": ") ", + "delete_cmd_prefix": "rm(", + "library": "var_list.r", + "varRefreshCmd": "cat(var_dic_list()) " + } + }, + "types_to_exclude": [ + "module", + "function", + "builtin_function_or_method", + "instance", + "_Feature" + ], + "window_display": false + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/delete_me.txt b/delete_me.txt new file mode 100644 index 0000000..257bcdd --- /dev/null +++ b/delete_me.txt @@ -0,0 +1 @@ +Delete this file when you find it diff --git a/fruit.txt b/fruit.txt new file mode 100644 index 0000000..b423a1a --- /dev/null +++ b/fruit.txt @@ -0,0 +1,3 @@ +Name a red fruit then come up with a question: + + diff --git a/tree_branch.txt b/tree_branch.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/tree_branch.txt @@ -0,0 +1 @@ +