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
| #itables | |
| from itables import init_notebook_mode | |
| init_notebook_mode(all_interactive=True) | |
| import world_bank_data as wb | |
| df = wb.get_countries() | |
| df | |
| #qgrid | |
| qgrid.show... |
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 scala.math.Integral.Implicits._ | |
| def location2utm(location_id:Long):(Long,Long,Long) = { | |
| // convert a location id to utm coordination | |
| // THIS IS THE UTM VALUE AS IS IN SS OUTPUTS. TO GET CORRECTED UTM/LAT-LON USE sstool.ssutm.SSUtm | |
| // return a tuple of (x, y, size) as left-bottom corner of a rectange | |
| // if location_id < 100000000000: | |
| // return None |
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
| #bash command completion | |
| source <(sq completion bash) | |
| #add source | |
| sq add ./CBDB_20200528.db -h @cbdb_20200528 | |
| #list source | |
| sq ls | |
| #inspecting, list table names |
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
| 大集群: hdfs://10.244.12.215:8020 | |
| 小集群: hdfs://10.244.12.75:8020 | |
| 花园集群: hdfs://10.244.13.106:8020 | |
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 networkx.drawing.nx_agraph import graphviz_layout, to_agraph | |
| from PIL import Image | |
| from io import BytesIO | |
| A = to_agraph(g2) | |
| A.layout(prog='dot') | |
| # graphviz_layout(prog=neato) | |
| img = A.draw(format='png') | |
| image = Image.open(BytesIO(img)) | |
| image.show(title="Graph") |
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
| case class TimeMatrixCase( | |
| userId: Long, | |
| windowDateList: List[String], | |
| sourceCellIdPlaceId: Map[String, Int], | |
| timeMatrix: List[List[Int]], | |
| time_map: Map[String, Int], | |
| weekdayDaySeconds: Map[String, Int], | |
| weekdayEveningSeconds: Map[String, Int], | |
| weekendDaySeconds: Map[String, Int], | |
| weekendEveningSeconds: Map[String, Int], |
OlderNewer