Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ```python
- %matplotlib inline
- import matplotlib
- import numpy as np
- import pandas as pd
- import os
- import matplotlib.pylab as plt
- ```
- ```python
- files = [f for f in os.listdir("/sw/apps/nasa") if f.endswith('csv')]
- ```
- ```python
- frames = []
- idx = 0
- for f in files:
- print(f)
- frames.append(pd.read_csv("/sw/apps/nasa/{}".format(f), header=None, names=["position","unixepoc","sdate", "stime", "metric", "val"]))
- frames[idx] = frames[idx].assign(timestamp=lambda x: x.sdate+" "+x.stime)
- frames[idx].timestamp = pd.to_datetime(frames[idx].timestamp)
- frames[idx] = frames[idx].drop(['sdate','stime','position','unixepoc','val'], axis=1)
- frames[idx] = frames[idx].set_index(['timestamp'])
- frames[idx].sort_index(inplace=True)
- idx += 1
- ```
- barometric pressure.csv
- humidity.csv
- solar radiation.csv
- sunrise.csv
- sunset.csv
- temperature.csv
- wind direction in degrees.csv
- wind speed.csv
- ## Barometric Pressure
- ```python
- frames[0].metric.plot(figsize=(16,5))
- ```
- <matplotlib.axes._subplots.AxesSubplot at 0x11c9a3198>
- ![png](output_4_1.png)
- ## Humidity
- ```python
- frames[1].metric.plot(figsize=(16,5))
- ```
- <matplotlib.axes._subplots.AxesSubplot at 0x1193dca90>
- ![png](output_6_1.png)
- ## Solar Radiation
- ```python
- frames[2].metric.plot(figsize=(16,5))
- ```
- <matplotlib.axes._subplots.AxesSubplot at 0x1193f6278>
- ![png](output_8_1.png)
- ## Sunrise
- ```python
- frames[3].metric.plot(figsize=(16,5))
- ```
- <matplotlib.axes._subplots.AxesSubplot at 0x11d7ec940>
- ![png](output_10_1.png)
- ## Sunset
- ```python
- frames[4].metric.plot(figsize=(16,5))
- ```
- <matplotlib.axes._subplots.AxesSubplot at 0x11d7885f8>
- ![png](output_12_1.png)
- ## Temperature
- ```python
- frames[5][frames[5].index.month==12].plot(figsize=(16,5))
- ```
- <matplotlib.axes._subplots.AxesSubplot at 0x12379cda0>
- ![png](output_14_1.png)
- ```python
- frames[5][frames[5].index.month==12].metric.describe()
- ```
- count 8164.000000
- mean 47.608893
- std 4.994597
- min 34.000000
- 25% 45.000000
- 50% 47.000000
- 75% 50.000000
- max 62.000000
- Name: metric, dtype: float64
- ```python
- frames[5].metric.plot(figsize=(16,5))
- ```
- <matplotlib.axes._subplots.AxesSubplot at 0x11d17a550>
- ![png](output_16_1.png)
- ## Wind Direction
- ```python
- frames[6].metric.plot(figsize=(16,5))
- ```
- <matplotlib.axes._subplots.AxesSubplot at 0x11d0c6cf8>
- ![png](output_18_1.png)
- ## Wind Speed
- ```python
- frames[7].metric.plot(figsize=(16,5))
- ```
- <matplotlib.axes._subplots.AxesSubplot at 0x11d7aec88>
- ![png](output_20_1.png)
- ```python
- ```
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement