|
27 | 27 | }, |
28 | 28 | { |
29 | 29 | "cell_type": "code", |
30 | | - "execution_count": 3, |
| 30 | + "execution_count": 1, |
31 | 31 | "metadata": {}, |
32 | 32 | "outputs": [], |
33 | 33 | "source": [ |
|
47 | 47 | }, |
48 | 48 | { |
49 | 49 | "cell_type": "code", |
50 | | - "execution_count": 4, |
| 50 | + "execution_count": 2, |
51 | 51 | "metadata": {}, |
52 | 52 | "outputs": [ |
53 | 53 | { |
|
78 | 78 | }, |
79 | 79 | { |
80 | 80 | "cell_type": "code", |
81 | | - "execution_count": 5, |
| 81 | + "execution_count": 3, |
82 | 82 | "metadata": {}, |
83 | 83 | "outputs": [ |
84 | 84 | { |
|
325 | 325 | "[5 rows x 96 columns]" |
326 | 326 | ] |
327 | 327 | }, |
328 | | - "execution_count": 5, |
| 328 | + "execution_count": 3, |
329 | 329 | "metadata": {}, |
330 | 330 | "output_type": "execute_result" |
331 | 331 | } |
|
379 | 379 | }, |
380 | 380 | { |
381 | 381 | "cell_type": "code", |
382 | | - "execution_count": 6, |
| 382 | + "execution_count": 4, |
383 | 383 | "metadata": {}, |
384 | 384 | "outputs": [], |
385 | 385 | "source": [ |
|
413 | 413 | }, |
414 | 414 | { |
415 | 415 | "cell_type": "code", |
416 | | - "execution_count": 7, |
| 416 | + "execution_count": 5, |
417 | 417 | "metadata": {}, |
418 | 418 | "outputs": [], |
419 | 419 | "source": [ |
|
428 | 428 | }, |
429 | 429 | { |
430 | 430 | "cell_type": "code", |
431 | | - "execution_count": 8, |
| 431 | + "execution_count": 6, |
432 | 432 | "metadata": {}, |
433 | 433 | "outputs": [], |
434 | 434 | "source": [ |
|
457 | 457 | }, |
458 | 458 | { |
459 | 459 | "cell_type": "code", |
460 | | - "execution_count": 9, |
| 460 | + "execution_count": 7, |
461 | 461 | "metadata": {}, |
462 | 462 | "outputs": [ |
463 | 463 | { |
|
588 | 588 | }, |
589 | 589 | { |
590 | 590 | "cell_type": "code", |
591 | | - "execution_count": 10, |
| 591 | + "execution_count": 8, |
592 | 592 | "metadata": {}, |
593 | 593 | "outputs": [], |
594 | 594 | "source": [ |
|
599 | 599 | }, |
600 | 600 | { |
601 | 601 | "cell_type": "code", |
602 | | - "execution_count": 11, |
| 602 | + "execution_count": 9, |
603 | 603 | "metadata": {}, |
604 | 604 | "outputs": [ |
605 | 605 | { |
|
684 | 684 | "4 21644 40.828028 -73.947308 89.0 100.0" |
685 | 685 | ] |
686 | 686 | }, |
687 | | - "execution_count": 11, |
| 687 | + "execution_count": 9, |
688 | 688 | "metadata": {}, |
689 | 689 | "output_type": "execute_result" |
690 | 690 | } |
|
725 | 725 | }, |
726 | 726 | { |
727 | 727 | "cell_type": "code", |
728 | | - "execution_count": 12, |
| 728 | + "execution_count": 10, |
729 | 729 | "metadata": {}, |
730 | 730 | "outputs": [], |
731 | 731 | "source": [ |
|
736 | 736 | }, |
737 | 737 | { |
738 | 738 | "cell_type": "code", |
739 | | - "execution_count": 13, |
| 739 | + "execution_count": 43, |
740 | 740 | "metadata": {}, |
741 | 741 | "outputs": [], |
742 | 742 | "source": [ |
|
804 | 804 | }, |
805 | 805 | { |
806 | 806 | "cell_type": "code", |
807 | | - "execution_count": 15, |
| 807 | + "execution_count": 20, |
808 | 808 | "metadata": {}, |
809 | 809 | "outputs": [], |
810 | 810 | "source": [ |
|
832 | 832 | " max_val = max(self.data[self.display])\n", |
833 | 833 | " scale = 'log' if self.display == 'dollar_price' else 'lin'\n", |
834 | 834 | " \n", |
835 | | - " for id in self.data['id']:\n", |
836 | | - " grp = self.data.where(self.data['id'] == id)\n", |
837 | | - " color = self.cmap.to_color(max(grp[self.display], 1), max_val, scale)\n", |
838 | | - " self.painter.set_color(color)\n", |
| 835 | + " for index, id in enumerate(self.data['id']):\n", |
| 836 | + " # log scale can't start at 0, must be 1\n", |
| 837 | + " min_val = max(self.data[self.display][index], 1)\n", |
839 | 838 | " \n", |
840 | | - " x, y = proj.lonlat_to_screen(grp['lon'], grp['lat'])\n", |
| 839 | + " color = self.cmap.to_color(min_val, max_val, scale)\n", |
| 840 | + " self.painter.set_color(color)\n", |
| 841 | + " lat, lon = self.data['lon'][index], self.data['lat'][index]\n", |
| 842 | + " x, y = proj.lonlat_to_screen(lat, lon)\n", |
841 | 843 | " self.painter.points(x, y, 5)\n", |
842 | 844 | " \n", |
843 | 845 | " def draw(self, proj, mouse_x, mouse_y, ui_manager):\n", |
|
869 | 871 | }, |
870 | 872 | { |
871 | 873 | "cell_type": "code", |
872 | | - "execution_count": 16, |
| 874 | + "execution_count": 21, |
873 | 875 | "metadata": {}, |
874 | 876 | "outputs": [], |
875 | 877 | "source": [ |
|
881 | 883 | }, |
882 | 884 | { |
883 | 885 | "cell_type": "code", |
884 | | - "execution_count": 17, |
| 886 | + "execution_count": 22, |
885 | 887 | "metadata": {}, |
886 | 888 | "outputs": [], |
887 | 889 | "source": [ |
|
890 | 892 | "geoplotlib.add_layer(ValueLayer(data, bbox=ny_bbox))\n", |
891 | 893 | "geoplotlib.show()" |
892 | 894 | ] |
| 895 | + }, |
| 896 | + { |
| 897 | + "cell_type": "code", |
| 898 | + "execution_count": null, |
| 899 | + "metadata": {}, |
| 900 | + "outputs": [], |
| 901 | + "source": [] |
893 | 902 | } |
894 | 903 | ], |
895 | 904 | "metadata": { |
|
0 commit comments