Advertisement
Guest User

Untitled

a guest
Aug 25th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.59 KB | None | 0 0
  1. {
  2. "cells": [
  3. {
  4. "cell_type": "markdown",
  5. "metadata": {},
  6. "source": [
  7. "### Carga en Python de datos en formato csv usando Pandas "
  8. ]
  9. },
  10. {
  11. "cell_type": "code",
  12. "execution_count": 10,
  13. "metadata": {},
  14. "outputs": [
  15. {
  16. "name": "stdout",
  17. "output_type": "stream",
  18. "text": [
  19. "(768, 9)\n",
  20. " Pregnancies Glucose BloodPressure SkinThickness Insulin BMI \\\n",
  21. "0 6 148 72 35 0 33.6 \n",
  22. "1 1 85 66 29 0 26.6 \n",
  23. "2 8 183 64 0 0 23.3 \n",
  24. "3 1 89 66 23 94 28.1 \n",
  25. "4 0 137 40 35 168 43.1 \n",
  26. "5 5 116 74 0 0 25.6 \n",
  27. "6 3 78 50 32 88 31.0 \n",
  28. "7 10 115 0 0 0 35.3 \n",
  29. "8 2 197 70 45 543 30.5 \n",
  30. "9 8 125 96 0 0 0.0 \n",
  31. "\n",
  32. " DiabetesPedigreeFunction Age Outcome \n",
  33. "0 0.627 50 1 \n",
  34. "1 0.351 31 0 \n",
  35. "2 0.672 32 1 \n",
  36. "3 0.167 21 0 \n",
  37. "4 2.288 33 1 \n",
  38. "5 0.201 30 0 \n",
  39. "6 0.248 26 1 \n",
  40. "7 0.134 29 0 \n",
  41. "8 0.158 53 1 \n",
  42. "9 0.232 54 1 \n"
  43. ]
  44. }
  45. ],
  46. "source": [
  47. "import pandas\n",
  48. "filename = 'diabetes.csv'\n",
  49. "data = pandas.read_csv(filename, header=0)\n",
  50. "\n",
  51. "print(data.shape)\n",
  52. "print (data.head(10))"
  53. ]
  54. },
  55. {
  56. "cell_type": "code",
  57. "execution_count": null,
  58. "metadata": {
  59. "collapsed": true
  60. },
  61. "outputs": [],
  62. "source": []
  63. }
  64. ],
  65. "metadata": {
  66. "kernelspec": {
  67. "display_name": "Python 3",
  68. "language": "python",
  69. "name": "python3"
  70. },
  71. "language_info": {
  72. "codemirror_mode": {
  73. "name": "ipython",
  74. "version": 3
  75. },
  76. "file_extension": ".py",
  77. "mimetype": "text/x-python",
  78. "name": "python",
  79. "nbconvert_exporter": "python",
  80. "pygments_lexer": "ipython3",
  81. "version": "3.6.3"
  82. }
  83. },
  84. "nbformat": 4,
  85. "nbformat_minor": 2
  86. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement