Skip to content

Instantly share code, notes, and snippets.

df = spark.read.raster(catalog,
catalog_col_names=['B01', 'B02'],
) \
.withColumnRenamed('B01', 'red') \
.withColumnRenamed('B02', 'nir')
start = '2018-07-01'
end = '2019-08-31'
catalog = earth_ondemand.read_catalog(
geo="POINT(88.92 21.88)", # Coordinates of Sunderban National Park
start_datetime=start,
end_datetime=end,
collections='mcd43a4',
)
@parulnith
parulnith / README-Template.md
Last active June 7, 2019 10:06 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

S.nO Name Age
1 Andy 56
,CRIM,ZN,INDUS,CHAS,NOX,RM,AGE,DIS,RAD,TAX,PTRATIO,B,LSTAT
0,0.00632,18,2.31,0,0.538,6.575,65.2,4.09,1,296,15.3,396.9,4.98
1,0.02731,0,7.07,0,0.469,6.421,78.9,4.9671,2,242,17.8,396.9,9.14
2,0.02729,0,7.07,0,0.469,7.185,61.1,4.9671,2,242,17.8,392.83,4.03
3,0.03237,0,2.18,0,0.458,6.998,45.8,6.0622,3,222,18.7,394.63,2.94
4,0.06905,0,2.18,0,0.458,7.147,54.2,6.0622,3,222,18.7,396.9,5.33
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 5 columns, instead of 1. in line 1.
fixed acidity,volatile acidity,citric acid,residual,sugar chlorides free sulfur dioxide total sulfur dioxide density pH sulphates alcohol quality
1 -0.0226973 0.289181 0.0890207 0.0230856 -0.0493959 0.0910698 0.265331 -0.425858 -0.017143 -0.120881 -0.113663
-0.0226973 1 -0.149472 0.0642861 0.0705116 -0.0970119 0.0892605 0.0271138 -0.0319154 -0.0357281 0.0677179 -0.194723
0.289181 -0.149472 1 0.0942116 0.114364 0.0940772 0.121131 0.149503 -0.163748 0.0623309 -0.0757287 -0.00920909
0.0890207 0.0642861 0.0942116 1 0.0886845 0.299098 0.401439 0.838966 -0.194133 -0.0266644 -0.450631 -0.0975768
0.0230856 0.0705116 0.114364 0.0886845 1 0.101392 0.19891 0.257211 -0.0904395 0.0167629 -0.360189 -0.209934
-0.0493959 -0.0970119 0.0940772 0.299098 0.101392 1 0.615501 0.29421 -0.000617796 0.0592172 -0.250104 0.00815807
0.0910698 0.0892605 0.121131 0.401439 0.19891 0.615501 1 0.529881 0.00232097 0.134562 -0.448892 -0.174737
0.265331 0.0271138 0.149503 0.838966 0.257211 0.29421 0.529881 1 -0.0935915 0.0744931 -0.780138 -0.30
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import matplotlib
from matplotlib import pyplot as plt
from celluloid import Camera
fig = plt.figure()
camera = Camera(fig)
for i in range(20):
t = plt.plot(range(i, i + 5))
plt.legend(t, [f'line {i}'])
camera.snap()
import numpy as np
from matplotlib import pyplot as plt
from celluloid import Camera
fig, axes = plt.subplots(2)
camera = Camera(fig)
t = np.linspace(0, 2 * np.pi, 128, endpoint=False)
for i in t:
axes[0].plot(t, np.sin(t + i), color='blue')
axes[1].plot(t, np.sin(t - i), color='blue')
from matplotlib import pyplot as plt
from celluloid import Camera
fig = plt.figure()
camera = Camera(fig)
for i in range(10):
plt.plot([i] * 10)
camera.snap()
animation = camera.animate()
animation.save('celluloid_minimal.gif', writer = 'imagemagick')