Search found 702 matches

by Daniel Wee
Fri 04 May 04 2018 12:03 am
Forum: Projects
Topic: Mapbox utilization
Replies: 2
Views: 149

Re: Mapbox utilization

For multiple markers in an array, see:-

https://plot.ly/python/scattermapbox/#new-to-plotly
by Daniel Wee
Fri 04 May 04 2018 12:01 am
Forum: Projects
Topic: Mapbox utilization
Replies: 2
Views: 149

Re: Mapbox utilization

Minimal code using offline plotly here. Outputs a map with a marker to a named html file which can then be opened up in a browser. For more info on offline mode, see:- https://www.reddit.com/r/IPython/comments/3tibc8/tip_on_how_to_run_plotly_examples_in_offline_mode/ import plotly.offline as py from...
by Daniel Wee
Fri 04 May 04 2018 12:00 am
Forum: Projects
Topic: Mapbox utilization
Replies: 2
Views: 149

Mapbox utilization

For offline calculation of tiles required, use:-

https://www.mapbox.com/help/offline-estimator/

Bounding box of:
SW 1.21766 103.60073
NE 1.47212 104.03532

Min zoom: 10
Max zoom: 16

Tiles required: 5300
by Daniel Wee
Tue 01 May 01 2018 2:45 pm
Forum: Other Stuff
Topic: Setting up Ubuntu 18.04 LTS
Replies: 0
Views: 98

Setting up Ubuntu 18.04 LTS

1. LVM causes some unnecessary complexities - avoid if not needed

2. Fractional scaling with:

xrandr --output DP-1 --scale 0.75x0.75
by Daniel Wee
Mon 23 Apr 23 2018 4:23 pm
Forum: Projects
Topic: Object Recognition
Replies: 7
Views: 1592

Re: Object Recognition

by Daniel Wee
Thu 12 Apr 12 2018 1:17 pm
Forum: Other Stuff
Topic: Using Dash
Replies: 4
Views: 243

Using Dash

import dash from dash.dependencies import Input, Output import dash_core_components as dcc import dash_html_components as html app = dash.Dash() # define the layout of the page app.layout = html.Div([ dcc.Input(id='input', value='Enter something here!', type='text'), html.Div(id='output') ]) # defi...
by Daniel Wee
Thu 12 Apr 12 2018 12:40 pm
Forum: Other Stuff
Topic: Reading Google Sheets with python
Replies: 4
Views: 175

Re: Reading Google Sheets with python

import pandas as pd import numpy as np import gspread from oauth2client.service_account import ServiceAccountCredentials def normalize(ustr): retval = 0 if ustr != "" and str(ustr).isdigit(): retval = int(str(ustr).replace("-","0")) return retval def parse_sheet(wks): columns=['date','e1','e2','e3'...
by Daniel Wee
Wed 11 Apr 11 2018 11:31 pm
Forum: Other Stuff
Topic: Reading Google Sheets with python
Replies: 4
Views: 175

Re: Reading Google Sheets with python

#!/usr/bin/env python import gspread from oauth2client.service_account import ServiceAccountCredentials #This extended scope is needed for this to work scope = ['https://spreadsheets.google.com/feeds', 'https://www.googleapis.com/auth/drive'] credentials = ServiceAccountCredentials.from_json_keyfil...
by Daniel Wee
Wed 11 Apr 11 2018 11:13 pm
Forum: Other Stuff
Topic: Reading Google Sheets with python
Replies: 4
Views: 175

Re: Reading Google Sheets with python

sudo -H pip install oauth2client PyOpenSSL gspread --upgrade
by Daniel Wee
Wed 11 Apr 11 2018 11:07 pm
Forum: Other Stuff
Topic: Reading Google Sheets with python
Replies: 4
Views: 175

Re: Reading Google Sheets with python

1. Go to the Google APIs Console 2. Create a new project 3. Click Enable API. Search for and enable the Google Drive API 4. Create credentials for a Web Server to access Application Data 5. Name the service account and grant it a Project Role of Editor 6. Download the JSON file 7. Copy the JSON file...