This file contains hidden or 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 requests | |
| response = requests.get('https://servicodados.ibge.gov.br/api/v1/localidades/municipios') | |
| df = pd.read_json(response.text) | |
| cidades = df['nome'] | |
| cidades.to_csv("cidades.csv", index=False) |
This file contains hidden or 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
| # Imports | |
| import tensorflow as tf | |
| import numpy as np | |
| from tensorflow import keras | |
| # Define and compile the Neural Network (NN) | |
| model = tf.keras.Sequential([keras.layers.Dense(units=1, input_shape=[1])]) # Only 1 neuron | |
| # Compile the NN | |
| model.compile(optimizer='sgd', loss='mean_squared_error') |
This file contains hidden or 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 datetime import datetime | |
| day_of_year = datetime.now().timetuple().tm_yday | |
| print(f"What's the Current Day Number? {day_of_year} days have passed since the beginning of the year.") |
This file contains hidden or 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 textblob import TextBlob | |
| def sentiment(text): | |
| base_text = TextBlob(text) | |
| sentiment_score = base_text.sentiment.polarity | |
| if sentiment_score < 0: | |
| return 'Negative' | |
| elif sentiment_score == 0: | |
| return 'Neutral' | |
| return 'Positive' |
This file contains hidden or 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
| # Basic libraries | |
| import requests | |
| import pandas as pd | |
| import json | |
| # Define API URL | |
| url = 'API_link' | |
| # Consume API | |
| response = requests.get(url).json() |
This file contains hidden or 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
| Get-ChildItem -Filter *.csv | Select-Object -ExpandProperty FullName | Import-Csv | Export-Csv .\combinedcsvs.csv -NoTypeInformation -Encoding UTF8 -Append |
This file contains hidden or 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
| # Instalar o pyttsx3 com o comando abaixo: | |
| # pip install pyttsx3 | |
| import pyttsx3 | |
| # Iniciando a biblioteca na variável engine | |
| engine = pyttsx3.init() | |
| # Função pronta para uso | |
| def speak(speech): |
NewerOlder