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
df['color'] = df['color'].astype('category') | |
print(df.info(memory_usage="deep")) |
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 random | |
colors = ['WHITE', 'BLACK','RED','YELLOW','BLUE','GREEN'] | |
colors_column = [random.choice(colors) for x in range(1000)] | |
df = pd.DataFrame({'color':colors_column}) | |
print(df.info(memory_usage="deep")) |
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 ethairballoons.ethairballoons import ethairBalloons | |
prov = ethairBalloons('127.0.0.1', '..') | |
carSchema = prov.createSchema(modelDefinition={ | |
'name': "Car", | |
'contractName': "carsContract", | |
'properties': [{ | |
'name': "model", | |
'type': "bytes32", |
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
interface Options { | |
color: string; | |
volume: number; | |
} |
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
const path = require('path'); | |
module.exports = { | |
entry: './src/index.ts', | |
module: { | |
rules: [ | |
{ | |
test: /\.tsx?$/, | |
use: 'ts-loader', | |
exclude: /node_modules/, |
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
Show hidden characters
{ | |
"compilerOptions": { | |
"outDir": "./dist/", | |
"noImplicitAny": true, | |
"sourceMap": true, | |
"module": "es6", | |
"target": "es5", | |
"jsx": "react", | |
"allowJs": true, | |
"moduleResolution": "node" |
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 React from 'react' | |
import './App.css' | |
import { ToastContainer, toast } from 'react-toastify'; | |
import 'react-toastify/dist/ReactToastify.css'; | |
function App() { | |
const notifyDefault = () => toast("A toast alert!"); | |
const notifyTimeout = () => toast("Dismiss after 8 secs", {autoClose: 8000}); | |
const notifyTopLeft = () => toast("This appears on top left corner", {position: 'top-left'}); | |
const notifyNotBar = () => toast("This does not have the bar", {hideProgressBar: true}); |
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 React from 'react' | |
import './App.css' | |
import { ToastContainer, toast } from 'react-toastify'; | |
import 'react-toastify/dist/ReactToastify.css'; | |
function App() { | |
const notifyDefault = () => toast("A toast alert!"); | |
return ( | |
<div className="App"> | |
<div style={{ marginTop: '2em' }}> |
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
"scripts": { | |
"start": "react-scripts start", | |
"build": "react-scripts build", | |
"test": "jest", | |
"eject": "react-scripts eject" | |
} |
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
module.exports = { | |
presets: [ | |
['@babel/preset-env', {targets: {node: 'current'}}], | |
'@babel/preset-typescript', | |
], | |
}; |