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
var gender = "male" | |
// Traditional if-else | |
if (gender === "male") { | |
console.log("Male gender.") | |
} else { | |
console.log("Other gender.") | |
} | |
// Ternary operator |
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
var a = (function () { | |
var name = "João" | |
return name | |
})() | |
console.log(a) // "João" | |
var b = (function () { | |
console.log("----") | |
})() | |
console.log(b) // undefined - there is no return to b |
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
var a = 10 // number | |
var c = "10" // string | |
console.log(a === c) // false |
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
var a = 10 // number | |
var b = 10 // number | |
console.log(a == b) // true | |
var c = "10" // string | |
console.log(c == b) // also true |
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 | |
import numpy as np | |
df = pd.DataFrame(np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9]]), | |
columns=['a', 'b', 'c']) | |
print(df) |
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 | |
import ploty.express as px | |
# Dados tratados | |
df98 = calculaPercentil98(df) | |
# Cria grupos | |
bins = 20 # Quantidade de grupos | |
min_value = df98["Taxa %"].min() | |
max_value = df98["Taxa %"].max() |
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
# Valores não-numéricos/categóricos. Cores discretas. | |
fig1 = px.treemap(df98, path=["Ação"], | |
values="Taxa %", color="Ação") | |
# Valores numéricos. Cores contínuas. | |
fig1 = px.treemap(df98, path=["Ação"], | |
values="Taxa %", color="Taxa %") |
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 plotly.express as px | |
# Dados tratados da Parte 1, sem outliers. | |
df98 = calculaPercentil98(df) | |
# Simple treemap | |
fig1 = px.treemap(df98, path=["Ação"], values="Taxa %") | |
fig1.show() |
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 | |
import seaborn as sns | |
import matplotlib.pyplot as plt | |
from datetime import datetime | |
bins = 20 | |
# Criando o ambiente do gráfico | |
sns.set_style("white") | |
fig, ax = plt.subplots(1, 1, figsize=(15, 10)) |
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 | |
import matplotlib.pyplot as plt | |
import matplotlib.ticker as ticker | |
# Criando o ambiente do gráfico | |
sns.set_style("white") | |
plt.figure(figsize=(15, 10)) | |
# Gráfico de Dispersão | |
cmap = sns.cubehelix_palette(rot=-.4, as_cmap=True) |
NewerOlder