PageRenderTime 27ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/05_Merge/Auto_MPG/Exercises.ipynb

https://gitlab.com/santosh.sivapurapu-ab/pandas_exercises
Jupyter | 156 lines | 156 code | 0 blank | 0 comment | 0 complexity | c418af28ca29a8f16a8a5c2126ee0c34 MD5 | raw file
  1. {
  2. "cells": [
  3. {
  4. "cell_type": "markdown",
  5. "metadata": {},
  6. "source": [
  7. "# MPG Cars"
  8. ]
  9. },
  10. {
  11. "cell_type": "markdown",
  12. "metadata": {},
  13. "source": [
  14. "### Introduction:\n",
  15. "\n",
  16. "The following exercise utilizes data from [UC Irvine Machine Learning Repository](https://archive.ics.uci.edu/ml/datasets/Auto+MPG)\n",
  17. "\n",
  18. "### Step 1. Import the necessary libraries"
  19. ]
  20. },
  21. {
  22. "cell_type": "code",
  23. "execution_count": null,
  24. "metadata": {
  25. "collapsed": false
  26. },
  27. "outputs": [],
  28. "source": []
  29. },
  30. {
  31. "cell_type": "markdown",
  32. "metadata": {},
  33. "source": [
  34. "### Step 2. Import the first dataset [cars1](https://raw.githubusercontent.com/guipsamora/pandas_exercises/master/05_Merge/Auto_MPG/cars1.csv) and [cars2](https://raw.githubusercontent.com/guipsamora/pandas_exercises/master/05_Merge/Auto_MPG/cars2.csv). "
  35. ]
  36. },
  37. {
  38. "cell_type": "markdown",
  39. "metadata": {},
  40. "source": [
  41. " ### Step 3. Assign each to a variable called cars1 and cars2"
  42. ]
  43. },
  44. {
  45. "cell_type": "code",
  46. "execution_count": null,
  47. "metadata": {
  48. "collapsed": false
  49. },
  50. "outputs": [],
  51. "source": []
  52. },
  53. {
  54. "cell_type": "markdown",
  55. "metadata": {},
  56. "source": [
  57. "### Step 4. Ops it seems our first dataset has some unnamed blank columns, fix cars1"
  58. ]
  59. },
  60. {
  61. "cell_type": "code",
  62. "execution_count": null,
  63. "metadata": {
  64. "collapsed": false
  65. },
  66. "outputs": [],
  67. "source": []
  68. },
  69. {
  70. "cell_type": "markdown",
  71. "metadata": {},
  72. "source": [
  73. "### Step 5. What is the number of observations in each dataset?"
  74. ]
  75. },
  76. {
  77. "cell_type": "code",
  78. "execution_count": null,
  79. "metadata": {
  80. "collapsed": false
  81. },
  82. "outputs": [],
  83. "source": []
  84. },
  85. {
  86. "cell_type": "markdown",
  87. "metadata": {},
  88. "source": [
  89. "### Step 6. Join cars1 and cars2 into a single DataFrame called cars"
  90. ]
  91. },
  92. {
  93. "cell_type": "code",
  94. "execution_count": null,
  95. "metadata": {
  96. "collapsed": false
  97. },
  98. "outputs": [],
  99. "source": []
  100. },
  101. {
  102. "cell_type": "markdown",
  103. "metadata": {},
  104. "source": [
  105. "### Step 7. Ops there is a column missing, called owners. Create a random number Series from 15,000 to 73,000."
  106. ]
  107. },
  108. {
  109. "cell_type": "code",
  110. "execution_count": null,
  111. "metadata": {
  112. "collapsed": false
  113. },
  114. "outputs": [],
  115. "source": []
  116. },
  117. {
  118. "cell_type": "markdown",
  119. "metadata": {},
  120. "source": [
  121. "### Step 8. Add the column owners to cars"
  122. ]
  123. },
  124. {
  125. "cell_type": "code",
  126. "execution_count": null,
  127. "metadata": {
  128. "collapsed": false
  129. },
  130. "outputs": [],
  131. "source": []
  132. }
  133. ],
  134. "metadata": {
  135. "anaconda-cloud": {},
  136. "kernelspec": {
  137. "display_name": "Python [default]",
  138. "language": "python",
  139. "name": "python2"
  140. },
  141. "language_info": {
  142. "codemirror_mode": {
  143. "name": "ipython",
  144. "version": 2
  145. },
  146. "file_extension": ".py",
  147. "mimetype": "text/x-python",
  148. "name": "python",
  149. "nbconvert_exporter": "python",
  150. "pygments_lexer": "ipython2",
  151. "version": "2.7.12"
  152. }
  153. },
  154. "nbformat": 4,
  155. "nbformat_minor": 0
  156. }