|
70 | 70 | "editable": true |
71 | 71 | }, |
72 | 72 | "source": [ |
73 | | - "**Next, we'll read the input data file**, and store the contents of that file into a variable called `data` Using the `pandas.read_csv()` -function:" |
| 73 | + "**Next, we'll read the input data file**, and store the contents of that file into a variable called `data` Using the `pandas.read_csv()` function:" |
74 | 74 | ] |
75 | 75 | }, |
76 | 76 | { |
|
85 | 85 | } |
86 | 86 | }, |
87 | 87 | "outputs": [], |
88 | | - "source": [] |
| 88 | + "source": [ |
| 89 | + "# Read the file using pandas\n" |
| 90 | + ] |
89 | 91 | }, |
90 | 92 | { |
91 | 93 | "cell_type": "markdown", |
|
122 | 124 | } |
123 | 125 | }, |
124 | 126 | "outputs": [], |
125 | | - "source": [ |
126 | | - "print(data)" |
127 | | - ] |
| 127 | + "source": [] |
128 | 128 | }, |
129 | 129 | { |
130 | 130 | "cell_type": "markdown", |
|
303 | 303 | "No surprises here, our data variable is a Pandas DataFrame ;)." |
304 | 304 | ] |
305 | 305 | }, |
306 | | - { |
307 | | - "cell_type": "markdown", |
308 | | - "metadata": {}, |
309 | | - "source": [ |
310 | | - "Check more details about available paramenters and methods from [the pandas.DataFrame documentation](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html#pandas-dataframe)." |
311 | | - ] |
312 | | - }, |
313 | 306 | { |
314 | 307 | "cell_type": "markdown", |
315 | 308 | "metadata": { |
|
340 | 333 | }, |
341 | 334 | "outputs": [], |
342 | 335 | "source": [ |
343 | | - "# Display variable names:\n", |
344 | | - "%who" |
| 336 | + "# Display variable names:\n" |
345 | 337 | ] |
346 | 338 | }, |
347 | 339 | { |
|
350 | 342 | "metadata": {}, |
351 | 343 | "outputs": [], |
352 | 344 | "source": [ |
353 | | - "# Display variable name, type and info\n", |
354 | | - "%whos" |
| 345 | + "# Display variable name, type and info\n" |
355 | 346 | ] |
356 | 347 | }, |
357 | 348 | { |
|
621 | 612 | } |
622 | 613 | }, |
623 | 614 | "outputs": [], |
624 | | - "source": [] |
| 615 | + "source": [ |
| 616 | + "# Check datatype of the column\n" |
| 617 | + ] |
625 | 618 | }, |
626 | 619 | { |
627 | 620 | "cell_type": "markdown", |
|
656 | 649 | "execution_count": null, |
657 | 650 | "metadata": {}, |
658 | 651 | "outputs": [], |
659 | | - "source": [ |
660 | | - "type(data.TEMP)" |
661 | | - ] |
| 652 | + "source": [] |
662 | 653 | }, |
663 | 654 | { |
664 | 655 | "cell_type": "markdown", |
|
768 | 759 | "execution_count": null, |
769 | 760 | "metadata": {}, |
770 | 761 | "outputs": [], |
771 | | - "source": [ |
772 | | - "%matplotlib inline" |
773 | | - ] |
| 762 | + "source": [] |
774 | 763 | }, |
775 | 764 | { |
776 | 765 | "cell_type": "markdown", |
|
784 | 773 | "execution_count": null, |
785 | 774 | "metadata": {}, |
786 | 775 | "outputs": [], |
787 | | - "source": [ |
788 | | - "data[[\"TEMP\", \"MAX\", \"MIN\"]].plot()" |
789 | | - ] |
| 776 | + "source": [] |
790 | 777 | }, |
791 | 778 | { |
792 | 779 | "cell_type": "markdown", |
|
827 | 814 | }, |
828 | 815 | "outputs": [], |
829 | 816 | "source": [ |
830 | | - "# Create Pandas Series from a list\n", |
831 | | - "number_series = pd.Series([ 4, 5, 6, 7.0])\n", |
832 | | - "print(number_series)" |
| 817 | + "# Create Pandas Series from a list\n" |
833 | 818 | ] |
834 | 819 | }, |
835 | 820 | { |
|
854 | 839 | "execution_count": null, |
855 | 840 | "metadata": {}, |
856 | 841 | "outputs": [], |
857 | | - "source": [ |
858 | | - "number_series = pd.Series([ 4, 5, 6, 7.0], index=['a','b','c','d'])\n", |
859 | | - "print(number_series)" |
860 | | - ] |
| 842 | + "source": [] |
861 | 843 | }, |
862 | 844 | { |
863 | 845 | "cell_type": "code", |
864 | 846 | "execution_count": null, |
865 | 847 | "metadata": {}, |
866 | 848 | "outputs": [], |
867 | | - "source": [ |
868 | | - "type(number_series)" |
869 | | - ] |
| 849 | + "source": [] |
870 | 850 | }, |
871 | 851 | { |
872 | 852 | "cell_type": "markdown", |
|
903 | 883 | "execution_count": null, |
904 | 884 | "metadata": {}, |
905 | 885 | "outputs": [], |
906 | | - "source": [ |
907 | | - "new_data = pd.DataFrame(data = {\"station_name\" : stations, \"lat\" : lats, \"lon\" : lons})\n", |
908 | | - "new_data" |
909 | | - ] |
| 886 | + "source": [] |
910 | 887 | }, |
911 | 888 | { |
912 | 889 | "cell_type": "code", |
913 | 890 | "execution_count": null, |
914 | 891 | "metadata": {}, |
915 | 892 | "outputs": [], |
916 | | - "source": [ |
917 | | - "type(new_data)" |
918 | | - ] |
| 893 | + "source": [] |
919 | 894 | }, |
920 | 895 | { |
921 | 896 | "cell_type": "markdown", |
|
929 | 904 | "execution_count": null, |
930 | 905 | "metadata": {}, |
931 | 906 | "outputs": [], |
932 | | - "source": [ |
933 | | - "df = pd.DataFrame()" |
934 | | - ] |
| 907 | + "source": [] |
935 | 908 | }, |
936 | 909 | { |
937 | 910 | "cell_type": "code", |
938 | 911 | "execution_count": null, |
939 | 912 | "metadata": {}, |
940 | 913 | "outputs": [], |
| 914 | + "source": [] |
| 915 | + }, |
| 916 | + { |
| 917 | + "cell_type": "markdown", |
| 918 | + "metadata": {}, |
941 | 919 | "source": [ |
942 | | - "print(df)" |
| 920 | + "Check more details about available paramenters and methods from [the pandas.DataFrame documentation](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.html#pandas-dataframe)." |
943 | 921 | ] |
944 | 922 | }, |
945 | 923 | { |
|
956 | 934 | "metadata": { |
957 | 935 | "anaconda-cloud": {}, |
958 | 936 | "kernelspec": { |
959 | | - "display_name": "Python [default]", |
| 937 | + "display_name": "Python 3", |
960 | 938 | "language": "python", |
961 | 939 | "name": "python3" |
962 | 940 | }, |
|
970 | 948 | "name": "python", |
971 | 949 | "nbconvert_exporter": "python", |
972 | 950 | "pygments_lexer": "ipython3", |
973 | | - "version": "3.5.6" |
| 951 | + "version": "3.7.3" |
974 | 952 | } |
975 | 953 | }, |
976 | 954 | "nbformat": 4, |
|
0 commit comments