{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[],"mount_file_id":"13dQOLnAYp359h5ch3EVdhQIyFIcj7qdb","authorship_tag":"ABX9TyM/2/3dzTogx+WXTgtoOH/4"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[{"cell_type":"code","execution_count":1,"metadata":{"id":"Cdg5QVtB_0LG","executionInfo":{"status":"ok","timestamp":1672199427921,"user_tz":-330,"elapsed":1564,"user":{"displayName":"Putturu kusumakar Reddy","userId":"07552141107752951949"}}},"outputs":[],"source":["import pandas as pd\n","import numpy as np"]},{"cell_type":"code","source":["df1 = pd.read_csv(\"/content/AllStationsData_PHD.txt\",sep = \"|\")"],"metadata":{"id":"gbr09RAXDtin","executionInfo":{"status":"ok","timestamp":1672199432507,"user_tz":-330,"elapsed":3,"user":{"displayName":"Putturu kusumakar Reddy","userId":"07552141107752951949"}}},"execution_count":2,"outputs":[]},{"cell_type":"code","source":["df1.head(5)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":270},"id":"oHHIoo5fECv-","executionInfo":{"status":"ok","timestamp":1672199445277,"user_tz":-330,"elapsed":1002,"user":{"displayName":"Putturu kusumakar Reddy","userId":"07552141107752951949"}},"outputId":"766d3d98-3ed3-4bd3-da72-85aa7b4479eb"},"execution_count":3,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" WeatherStationID AirportID GroundHeight StationHeight BarometerHeight \\\n","0 3011 TEX 0 0 0 \n","1 3012 SKX 0 0 0 \n","2 3013 LAA 3683 3703 3675 \n","3 3014 4SL 0 6909 0 \n","4 3016 RIL 5503 5544 5506 \n","\n"," Latitude Longitude TimeZone \n","0 37.57 -107.55 +7 \n","1 36.28 -105.40 +7 \n","2 38.04 -102.41 +7 \n","3 35.47 -107.14 +7 \n","4 39.32 -107.44 +7 "],"text/html":["\n","
\n","
\n","
\n","\n","
\n"," \n"," \n"," | \n"," WeatherStationID | \n"," AirportID | \n"," GroundHeight | \n"," StationHeight | \n"," BarometerHeight | \n"," Latitude | \n"," Longitude | \n"," TimeZone | \n","
\n"," \n"," \n"," \n"," 0 | \n"," 3011 | \n"," TEX | \n"," 0 | \n"," 0 | \n"," 0 | \n"," 37.57 | \n"," -107.55 | \n"," +7 | \n","
\n"," \n"," 1 | \n"," 3012 | \n"," SKX | \n"," 0 | \n"," 0 | \n"," 0 | \n"," 36.28 | \n"," -105.40 | \n"," +7 | \n","
\n"," \n"," 2 | \n"," 3013 | \n"," LAA | \n"," 3683 | \n"," 3703 | \n"," 3675 | \n"," 38.04 | \n"," -102.41 | \n"," +7 | \n","
\n"," \n"," 3 | \n"," 3014 | \n"," 4SL | \n"," 0 | \n"," 6909 | \n"," 0 | \n"," 35.47 | \n"," -107.14 | \n"," +7 | \n","
\n"," \n"," 4 | \n"," 3016 | \n"," RIL | \n"," 5503 | \n"," 5544 | \n"," 5506 | \n"," 39.32 | \n"," -107.44 | \n"," +7 | \n","
\n"," \n","
\n","
\n","
\n"," \n"," \n","\n"," \n","
\n","
\n"," "]},"metadata":{},"execution_count":3}]},{"cell_type":"code","source":["df1.dtypes"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"kLGk5BGpEFXs","executionInfo":{"status":"ok","timestamp":1672199475075,"user_tz":-330,"elapsed":1227,"user":{"displayName":"Putturu kusumakar Reddy","userId":"07552141107752951949"}},"outputId":"d23e3805-9d53-4782-f8ea-bfc14c0b879f"},"execution_count":4,"outputs":[{"output_type":"execute_result","data":{"text/plain":["WeatherStationID int64\n","AirportID object\n","GroundHeight int64\n","StationHeight int64\n","BarometerHeight int64\n","Latitude float64\n","Longitude float64\n","TimeZone object\n","dtype: object"]},"metadata":{},"execution_count":4}]},{"cell_type":"code","source":["df1.shape"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"LLH4Im5-EJ9i","executionInfo":{"status":"ok","timestamp":1672199480960,"user_tz":-330,"elapsed":1663,"user":{"displayName":"Putturu kusumakar Reddy","userId":"07552141107752951949"}},"outputId":"b17aec45-6dbe-43bb-e4da-ac10938ad0f3"},"execution_count":5,"outputs":[{"output_type":"execute_result","data":{"text/plain":["(1744, 8)"]},"metadata":{},"execution_count":5}]},{"cell_type":"code","source":["df1[\"WeatherStationID\"].mode()"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"5ciWNzybFlIJ","executionInfo":{"status":"ok","timestamp":1672199494296,"user_tz":-330,"elapsed":1585,"user":{"displayName":"Putturu kusumakar Reddy","userId":"07552141107752951949"}},"outputId":"97d58348-e33e-4208-e187-4a40a990eafd"},"execution_count":6,"outputs":[{"output_type":"execute_result","data":{"text/plain":["0 3011\n","1 3012\n","2 3013\n","3 3014\n","4 3016\n"," ... \n","1739 94997\n","1740 94998\n","1741 94999\n","1742 96401\n","1743 96402\n","Length: 1744, dtype: int64"]},"metadata":{},"execution_count":6}]},{"cell_type":"markdown","source":["So all station id s are unique"],"metadata":{"id":"8dukebWQ22eM"}},{"cell_type":"code","source":["df1.isna().mean()"],"metadata":{"id":"tuLCOcf8F5by","executionInfo":{"status":"ok","timestamp":1672199517117,"user_tz":-330,"elapsed":19,"user":{"displayName":"Putturu kusumakar Reddy","userId":"07552141107752951949"}},"outputId":"33f075d5-a3b5-4e77-9217-c8c7d93663b9","colab":{"base_uri":"https://localhost:8080/"}},"execution_count":7,"outputs":[{"output_type":"execute_result","data":{"text/plain":["WeatherStationID 0.0\n","AirportID 0.0\n","GroundHeight 0.0\n","StationHeight 0.0\n","BarometerHeight 0.0\n","Latitude 0.0\n","Longitude 0.0\n","TimeZone 0.0\n","dtype: float64"]},"metadata":{},"execution_count":7}]},{"cell_type":"markdown","source":["So ther are no nan values"],"metadata":{"id":"Eeqn54Re276q"}},{"cell_type":"code","source":["df2 = pd.read_csv(\"/content/200401hourly.txt\")"],"metadata":{"id":"M7Rnv2dHXTCl"},"execution_count":null,"outputs":[]},{"cell_type":"code","source":["df2.head(5)"],"metadata":{"colab":{"base_uri":"https://localhost:8080/","height":305},"id":"DL5_g9ylXoFk","executionInfo":{"status":"ok","timestamp":1672157787704,"user_tz":-330,"elapsed":712,"user":{"displayName":"Putturu kusumakar Reddy","userId":"07552141107752951949"}},"outputId":"24c3ac56-3595-4259-8ba1-7b856cbcc83e"},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":[" WeatherStationID YearMonthDay Time SkyConditions Visibility \\\n","0 3034 20040101 10 OVC095 10SM \n","1 3035 20040101 10 SCT110 10SM \n","2 3039 20040101 10 OVC002 0.25SM \n","3 3040 20040101 10 CLR 10SM \n","4 4128 20040101 10 BKN001 BKN010 OVC024 4SM \n","\n"," DBT DewPointTemp RelativeHumidityPercent WindSpeed WindDirection \\\n","0 30.0 7.0 38.0 0.0 000 \n","1 43.0 18.0 37.0 0.0 000 \n","2 14.0 12.0 92.0 0.0 000 \n","3 30.0 21.0 69.0 9.0 250 \n","4 NaN NaN NaN 0.0 000 \n","\n"," WindGustValue StationPressure \n","0 0.0 30.10 \n","1 0.0 30.07 \n","2 0.0 30.01 \n","3 0.0 29.82 \n","4 0.0 29.80 "],"text/html":["\n"," \n","
\n","
\n","\n","
\n"," \n"," \n"," | \n"," WeatherStationID | \n"," YearMonthDay | \n"," Time | \n"," SkyConditions | \n"," Visibility | \n"," DBT | \n"," DewPointTemp | \n"," RelativeHumidityPercent | \n"," WindSpeed | \n"," WindDirection | \n"," WindGustValue | \n"," StationPressure | \n","
\n"," \n"," \n"," \n"," 0 | \n"," 3034 | \n"," 20040101 | \n"," 10 | \n"," OVC095 | \n"," 10SM | \n"," 30.0 | \n"," 7.0 | \n"," 38.0 | \n"," 0.0 | \n"," 000 | \n"," 0.0 | \n"," 30.10 | \n","
\n"," \n"," 1 | \n"," 3035 | \n"," 20040101 | \n"," 10 | \n"," SCT110 | \n"," 10SM | \n"," 43.0 | \n"," 18.0 | \n"," 37.0 | \n"," 0.0 | \n"," 000 | \n"," 0.0 | \n"," 30.07 | \n","
\n"," \n"," 2 | \n"," 3039 | \n"," 20040101 | \n"," 10 | \n"," OVC002 | \n"," 0.25SM | \n"," 14.0 | \n"," 12.0 | \n"," 92.0 | \n"," 0.0 | \n"," 000 | \n"," 0.0 | \n"," 30.01 | \n","
\n"," \n"," 3 | \n"," 3040 | \n"," 20040101 | \n"," 10 | \n"," CLR | \n"," 10SM | \n"," 30.0 | \n"," 21.0 | \n"," 69.0 | \n"," 9.0 | \n"," 250 | \n"," 0.0 | \n"," 29.82 | \n","
\n"," \n"," 4 | \n"," 4128 | \n"," 20040101 | \n"," 10 | \n"," BKN001 BKN010 OVC024 | \n"," 4SM | \n"," NaN | \n"," NaN | \n"," NaN | \n"," 0.0 | \n"," 000 | \n"," 0.0 | \n"," 29.80 | \n","
\n"," \n","
\n","
\n","
\n"," \n"," \n","\n"," \n","
\n","
\n"," "]},"metadata":{},"execution_count":4}]},{"cell_type":"code","source":["df2.dtypes"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"IAauKOEnXvDF","executionInfo":{"status":"ok","timestamp":1672157805700,"user_tz":-330,"elapsed":604,"user":{"displayName":"Putturu kusumakar Reddy","userId":"07552141107752951949"}},"outputId":"8bd3f3a1-ed7e-49fe-e3d2-d21bb50d6484"},"execution_count":null,"outputs":[{"output_type":"execute_result","data":{"text/plain":["WeatherStationID int64\n","YearMonthDay int64\n","Time int64\n","SkyConditions object\n","Visibility object\n","DBT float64\n","DewPointTemp float64\n","RelativeHumidityPercent float64\n","WindSpeed float64\n","WindDirection object\n","WindGustValue float64\n","StationPressure float64\n","dtype: object"]},"metadata":{},"execution_count":5}]},{"cell_type":"code","source":[],"metadata":{"id":"m3C4mUI0XzY0"},"execution_count":null,"outputs":[]}]}