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
| exports.get = async(req, res, next) => { | |
| try { | |
| const data = await repository.get(); | |
| res.status(200).send({data: data}); | |
| } catch (e) { | |
| res.status(500).send({ | |
| message: 'Falha ao processar sua requisição' | |
| }); | |
| } | |
| } |
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 | |
| purchase_1 = pd.Series({'Name': 'Chris', | |
| 'Item Purchased': 'Dog Food', | |
| 'Cost': 22.50}) | |
| purchase_2 = pd.Series({'Name': 'Kevyn', | |
| 'Item Purchased': 'Kitty Litter', | |
| 'Cost': 2.50}) | |
| purchase_3 = pd.Series({'Name': 'Vinod', | |
| 'Item Purchased': 'Bird Seed', |
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 | |
| purchase_1 = pd.Series({'Name': 'Chris', | |
| 'Item Purchased': 'Dog Food', | |
| 'Cost': 22.50}) | |
| purchase_2 = pd.Series({'Name': 'Kevyn', | |
| 'Item Purchased': 'Kitty Litter', | |
| 'Cost': 2.50}) | |
| purchase_3 = pd.Series({'Name': 'Vinod', | |
| 'Item Purchased': 'Bird Seed', |
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 numpy as np | |
| mylist = [1, 2, 3, 4] | |
| x = np.array(mylist) | |
| print(x) | |
| # array([1, 2, 3, 4]) | |
| y = np.array([1, 2, 3], [4, 6, 12]) | |
| print(y) | |
| # array([[1, 2, 3],[4, 6, 12]]) |
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
| people = ['Dr. Christopher Brooks', 'Dr. Kevyn Collins-Thompson', 'Dr. VG Vinod Vydiswaran', 'Dr. Daniel Romero'] | |
| def split_title_and_name(person): | |
| title = person.split()[0] | |
| lastname = person.split()[-1] | |
| return '{} {}'.format(title, lastname) | |
| list(map(split_title_and_name, people)) | |
| #['Dr. Brooks', 'Dr. Collins-Thompson', 'Dr. Vydiswaran', 'Dr. Romero'] |
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
| var string = "abcd"; | |
| var array = string.split(""); | |
| for(i=0; i<array.length;i++){ | |
| str = array[i].repeat(i+1); | |
| if(str.length == 1) { | |
| console.log(str.toUpperCase()); | |
| } else { | |
| primeira_posicao = str.substring(0,1); |
NewerOlder