This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a | b | c | |
---|---|---|---|
1 | 0 | One | |
2 | 0 | Two | |
3 | 0 | Three |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
pd.DataFrame({'a': [1,2,3], 'b': [0,0,0], 'c': ['One', 'Two', 'Three']}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# %hide-cell | |
print("This cell won't make it to the final document") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# %hide-output | |
print("This code will be shown, but it's output won't") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# %hide-source | |
print("This code won't be shown, but it's output will") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import seaborn as sns | |
x = np.arange(0, 10, 0.1) | |
y = np.sin(x) | |
sns.scatterplot(x = y,y = x); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
x = np.arange(0, 10, 0.1) | |
y = np.sin(x) | |
plt.plot(x,y); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nb2medium.upload import nb2medium | |
nb2medium(title = 'My First Article', notebook = 'path/to/notebook.ipynb'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fig['layout'] = go.Layout( | |
font = {'size' : 14}, | |
plot_bgcolor = 'white', | |
xaxis = {'showline': True, | |
'visible': True, | |
'range': (0, data['Value'].max()), | |
'title_text': 'Production Quantity (tonnes)' # title of the x axis | |
}, | |
yaxis = {'showline': False, | |
'visible': True, # to show the title |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1 Assign color to each unique item | |
from random import sample | |
colors = {item: 'rgb({}, {}, {})'.format(*sample(range(256), 3)) for item in data['Item'].unique()} | |
data['color'] = data['Item'].map(colors) | |
#2 Slice data, select earliest date available | |
##2.1 Select earliest year available | |
frame1 = data[data['Year'] == data['Year'].min()] |