Related
Have looked at previous similar questions and implemented suggestions but I am still having trouble getting a layer to appear on a Folium map. Basically I have used Here's isoline API to create an array of GeoJson data objects (these are bascially areas reacjable within certain drivetimes). I can render these drivetimes on a Here map but would like to use Folium as I think it's easier to set layer colors etc.
So the GeoJson objects (drivetimes) are stored in an array called "values".
My code is as follows:
# Create the map
m = folium.Map(location=[latitude, longitude], zoom_start=13)
# Add a marker to the map
folium.Marker(
[latitude, longitude]
).add_to(m)
# Add the layer
folium.GeoJson(data=value[0], name="geojson").add_to(m)
folium.LayerControl().add_to(m)
m
An example of one of the drivetimes is as follows, any help would be appreciated:
{"data": {"features": [{"geometry": {"coordinates": [[[-6.643639, 53.382568], [-6.635742, 53.382568], [-6.633682, 53.381882], [-6.632309, 53.380508], [-6.630249, 53.379822], [-6.622009, 53.379822], [-6.619949, 53.379135], [-6.618576, 53.377762], [-6.616516, 53.377075], [-6.611023, 53.377075], [-6.608963, 53.376389], [-6.60759, 53.375015], [-6.60553, 53.374329], [-6.600037, 53.374329], [-6.597977, 53.375015], [-6.596603, 53.376389], [-6.594543, 53.377075], [-6.586304, 53.377075], [-6.584244, 53.376389], [-6.58287, 53.372269], [-6.580811, 53.371582], [-6.564331, 53.371582], [-6.562271, 53.372269], [-6.560898, 53.373642], [-6.558838, 53.374329], [-6.556091, 53.374329], [-6.554031, 53.373642], [-6.552658, 53.372269], [-6.550598, 53.371582], [-6.548538, 53.372269], [-6.547852, 53.374329], [-6.547852, 53.377075], [-6.547165, 53.379135], [-6.544418, 53.381882], [-6.542358, 53.382568], [-6.540298, 53.381882], [-6.538925, 53.380508], [-6.537552, 53.380508], [-6.536179, 53.381882], [-6.534119, 53.382568], [-6.525879, 53.382568], [-6.523819, 53.381882], [-6.522446, 53.377762], [-6.520386, 53.377075], [-6.514893, 53.377075], [-6.512833, 53.376389], [-6.511459, 53.375015], [-6.509399, 53.374329], [-6.50116, 53.374329], [-6.4991, 53.373642], [-6.497726, 53.372269], [-6.495667, 53.371582], [-6.493607, 53.372269], [-6.493607, 53.373642], [-6.497726, 53.377762], [-6.498413, 53.379822], [-6.497726, 53.381882], [-6.49498, 53.384628], [-6.49292, 53.385315], [-6.490173, 53.385315], [-6.488113, 53.384628], [-6.48674, 53.383255], [-6.48468, 53.382568], [-6.479187, 53.382568], [-6.477127, 53.381882], [-6.475754, 53.380508], [-6.471634, 53.379135], [-6.470261, 53.377762], [-6.468201, 53.377075], [-6.465454, 53.377075], [-6.463394, 53.377762], [-6.463394, 53.379135], [-6.466141, 53.381882], [-6.470261, 53.383255], [-6.473007, 53.386002], [-6.473694, 53.388062], [-6.473694, 53.396301], [-6.47438, 53.398361], [-6.4785, 53.399734], [-6.479187, 53.401794], [-6.479187, 53.404541], [-6.479874, 53.406601], [-6.481934, 53.407288], [-6.483994, 53.406601], [-6.485367, 53.402481], [-6.487427, 53.401794], [-6.495667, 53.401794], [-6.497726, 53.402481], [-6.4991, 53.406601], [-6.500473, 53.406601], [-6.501846, 53.405228], [-6.503906, 53.404541], [-6.514893, 53.404541], [-6.516953, 53.405228], [-6.517639, 53.407288], [-6.517639, 53.410034], [-6.516953, 53.412094], [-6.514893, 53.412781], [-6.512146, 53.412781], [-6.510086, 53.413467], [-6.508713, 53.414841], [-6.504593, 53.416214], [-6.50322, 53.417587], [-6.4991, 53.418961], [-6.498413, 53.421021], [-6.4991, 53.42308], [-6.50116, 53.423767], [-6.517639, 53.423767], [-6.519699, 53.424454], [-6.521072, 53.428574], [-6.525192, 53.429947], [-6.526566, 53.43132], [-6.530685, 53.432693], [-6.533432, 53.43544], [-6.534119, 53.4375], [-6.533432, 53.43956], [-6.530685, 53.442307], [-6.528625, 53.442993], [-6.525879, 53.442993], [-6.523819, 53.442307], [-6.522446, 53.440933], [-6.518326, 53.43956], [-6.516953, 53.438187], [-6.514893, 53.4375], [-6.512146, 53.4375], [-6.510086, 53.436813], [-6.508713, 53.43544], [-6.506653, 53.434753], [-6.50116, 53.434753], [-6.4991, 53.434067], [-6.497726, 53.432693], [-6.493607, 53.43132], [-6.492233, 53.429947], [-6.49086, 53.429947], [-6.489487, 53.43132], [-6.485367, 53.432693], [-6.48468, 53.434753], [-6.485367, 53.436813], [-6.489487, 53.438187], [-6.490173, 53.440247], [-6.489487, 53.442307], [-6.488113, 53.44368], [-6.488113, 53.445053], [-6.49086, 53.4478], [-6.49292, 53.448486], [-6.498413, 53.448486], [-6.500473, 53.4478], [-6.501846, 53.446426], [-6.503906, 53.44574], [-6.509399, 53.44574], [-6.511459, 53.446426], [-6.512146, 53.448486], [-6.512146, 53.451233], [-6.512833, 53.453293], [-6.514893, 53.453979], [-6.517639, 53.453979], [-6.519699, 53.454666], [-6.521072, 53.456039], [-6.525192, 53.457413], [-6.527939, 53.460159], [-6.528625, 53.462219], [-6.527939, 53.464279], [-6.525192, 53.467026], [-6.523132, 53.467712], [-6.521072, 53.467026], [-6.519699, 53.465652], [-6.517639, 53.464966], [-6.515579, 53.465652], [-6.515579, 53.467026], [-6.536179, 53.487625], [-6.536865, 53.489685], [-6.536865, 53.492432], [-6.536179, 53.494492], [-6.534119, 53.495178], [-6.528625, 53.495178], [-6.526566, 53.494492], [-6.511459, 53.479385], [-6.509399, 53.478699], [-6.506653, 53.478699], [-6.504593, 53.479385], [-6.50322, 53.480759], [-6.50116, 53.481445], [-6.4991, 53.480759], [-6.497726, 53.479385], [-6.493607, 53.478012], [-6.481247, 53.465652], [-6.479874, 53.465652], [-6.4785, 53.469772], [-6.477127, 53.471146], [-6.477127, 53.472519], [-6.4785, 53.473892], [-6.479187, 53.475952], [-6.4785, 53.478012], [-6.475754, 53.480759], [-6.473694, 53.481445], [-6.470947, 53.481445], [-6.468887, 53.480759], [-6.466141, 53.478012], [-6.465454, 53.475952], [-6.465454, 53.470459], [-6.464767, 53.468399], [-6.462021, 53.465652], [-6.457901, 53.464279], [-6.457214, 53.462219], [-6.457214, 53.459473], [-6.457901, 53.457413], [-6.459961, 53.456726], [-6.465454, 53.456726], [-6.467514, 53.456039], [-6.470261, 53.453293], [-6.470261, 53.45192], [-6.467514, 53.449173], [-6.463394, 53.4478], [-6.462021, 53.446426], [-6.459961, 53.44574], [-6.448975, 53.44574], [-6.446915, 53.446426], [-6.445541, 53.450546], [-6.443481, 53.451233], [-6.437988, 53.451233], [-6.435928, 53.450546], [-6.434555, 53.449173], [-6.430435, 53.4478], [-6.429749, 53.44574], [-6.430435, 53.44368], [-6.431808, 53.442307], [-6.431808, 53.440933], [-6.430435, 53.43956], [-6.429749, 53.4375], [-6.430435, 53.43544], [-6.434555, 53.434067], [-6.435928, 53.432693], [-6.437988, 53.432007], [-6.440735, 53.432007], [-6.442795, 53.432693], [-6.444168, 53.434067], [-6.445541, 53.434067], [-6.446915, 53.429947], [-6.451035, 53.428574], [-6.451721, 53.426514], [-6.451035, 53.424454], [-6.446915, 53.42308], [-6.445541, 53.421707], [-6.444168, 53.421707], [-6.437302, 53.428574], [-6.433182, 53.429947], [-6.431808, 53.43132], [-6.429749, 53.432007], [-6.424255, 53.432007], [-6.422195, 53.43132], [-6.418076, 53.4272], [-6.416016, 53.426514], [-6.405029, 53.426514], [-6.402969, 53.425827], [-6.401596, 53.424454], [-6.397476, 53.42308], [-6.396103, 53.421707], [-6.394043, 53.421021], [-6.391983, 53.421707], [-6.387863, 53.425827], [-6.383743, 53.4272], [-6.383057, 53.42926], [-6.383743, 53.43132], [-6.385803, 53.432007], [-6.391296, 53.432007], [-6.393356, 53.432693], [-6.39473, 53.434067], [-6.39679, 53.434753], [-6.399536, 53.434753], [-6.401596, 53.43544], [-6.402283, 53.4375], [-6.402283, 53.440247], [-6.401596, 53.442307], [-6.399536, 53.442993], [-6.383057, 53.442993], [-6.380997, 53.44368], [-6.376877, 53.4478], [-6.374817, 53.448486], [-6.369324, 53.448486], [-6.367264, 53.4478], [-6.365891, 53.446426], [-6.363831, 53.44574], [-6.361771, 53.446426], [-6.361084, 53.448486], [-6.361084, 53.451233], [-6.361771, 53.453293], [-6.363831, 53.453979], [-6.369324, 53.453979], [-6.371384, 53.454666], [-6.37207, 53.456726], [-6.37207, 53.459473], [-6.371384, 53.461533], [-6.37001, 53.462906], [-6.37001, 53.464279], [-6.371384, 53.465652], [-6.372757, 53.469772], [-6.383743, 53.480759], [-6.385803, 53.481445], [-6.38855, 53.481445], [-6.39061, 53.482132], [-6.391983, 53.483505], [-6.396103, 53.484879], [-6.397476, 53.486252], [-6.399536, 53.486938], [-6.410522, 53.486938], [-6.412582, 53.487625], [-6.413956, 53.488998], [-6.418076, 53.490372], [-6.423569, 53.495865], [-6.424255, 53.497925], [-6.424255, 53.500671], [-6.424942, 53.502731], [-6.426315, 53.504105], [-6.427002, 53.506165], [-6.427002, 53.514404], [-6.426315, 53.516464], [-6.424255, 53.517151], [-6.418762, 53.517151], [-6.416702, 53.516464], [-6.413956, 53.513718], [-6.413269, 53.511658], [-6.413269, 53.506165], [-6.412582, 53.504105], [-6.411209, 53.502731], [-6.409836, 53.498611], [-6.408463, 53.498611], [-6.407089, 53.499985], [-6.405029, 53.500671], [-6.399536, 53.500671], [-6.397476, 53.501358], [-6.39679, 53.503418], [-6.39679, 53.506165], [-6.396103, 53.508224], [-6.394043, 53.508911], [-6.38855, 53.508911], [-6.38649, 53.508224], [-6.379623, 53.501358], [-6.377563, 53.500671], [-6.37207, 53.500671], [-6.37001, 53.499985], [-6.368637, 53.498611], [-6.364517, 53.497238], [-6.363831, 53.495178], [-6.363831, 53.492432], [-6.364517, 53.490372], [-6.368637, 53.488998], [-6.368637, 53.487625], [-6.367264, 53.486252], [-6.365891, 53.482132], [-6.363144, 53.479385], [-6.361084, 53.478699], [-6.352844, 53.478699], [-6.350784, 53.478012], [-6.348038, 53.475266], [-6.348038, 53.473892], [-6.349411, 53.472519], [-6.350098, 53.470459], [-6.349411, 53.468399], [-6.348038, 53.468399], [-6.346664, 53.469772], [-6.344604, 53.470459], [-6.339111, 53.470459], [-6.337051, 53.469772], [-6.331558, 53.464279], [-6.330872, 53.462219], [-6.331558, 53.460159], [-6.335678, 53.458786], [-6.335678, 53.457413], [-6.332932, 53.454666], [-6.330872, 53.453979], [-6.319885, 53.453979], [-6.317825, 53.454666], [-6.317139, 53.456726], [-6.317139, 53.459473], [-6.316452, 53.461533], [-6.314392, 53.462219], [-6.303406, 53.462219], [-6.301346, 53.462906], [-6.299973, 53.464279], [-6.297913, 53.464966], [-6.295166, 53.464966], [-6.293106, 53.464279], [-6.290359, 53.461533], [-6.288986, 53.457413], [-6.286926, 53.456726], [-6.27594, 53.456726], [-6.27388, 53.456039], [-6.271133, 53.453293], [-6.26976, 53.449173], [-6.268387, 53.449173], [-6.267014, 53.450546], [-6.264954, 53.451233], [-6.256714, 53.451233], [-6.254654, 53.450546], [-6.253281, 53.448486], [-6.251907, 53.447113], [-6.250534, 53.4478], [-6.249161, 53.449173], [-6.247787, 53.453293], [-6.245728, 53.453979], [-6.234741, 53.453979], [-6.232681, 53.454666], [-6.228561, 53.458786], [-6.226501, 53.459473], [-6.221008, 53.459473], [-6.218948, 53.460159], [-6.218948, 53.461533], [-6.220322, 53.462906], [-6.221008, 53.464966], [-6.221008, 53.475952], [-6.220322, 53.478012], [-6.218262, 53.478699], [-6.215515, 53.478699], [-6.213455, 53.479385], [-6.212769, 53.481445], [-6.212769, 53.489685], [-6.212082, 53.491745], [-6.207962, 53.495865], [-6.207275, 53.497925], [-6.207275, 53.508911], [-6.206589, 53.510971], [-6.204529, 53.511658], [-6.199036, 53.511658], [-6.196976, 53.510971], [-6.194229, 53.508224], [-6.193542, 53.506165], [-6.193542, 53.495178], [-6.194229, 53.493118], [-6.195602, 53.491745], [-6.195602, 53.490372], [-6.194229, 53.488998], [-6.193542, 53.486938], [-6.193542, 53.484192], [-6.192856, 53.482132], [-6.191483, 53.480759], [-6.190796, 53.478699], [-6.191483, 53.476639], [-6.195602, 53.472519], [-6.196289, 53.470459], [-6.196289, 53.451233], [-6.195602, 53.449173], [-6.191483, 53.4478], [-6.188736, 53.445053], [-6.188049, 53.442993], [-6.188736, 53.440933], [-6.191483, 53.438187], [-6.193542, 53.4375], [-6.199036, 53.4375], [-6.201096, 53.436813], [-6.206589, 53.43132], [-6.206589, 53.429947], [-6.204529, 53.42926], [-6.193542, 53.42926], [-6.191483, 53.428574], [-6.190109, 53.4272], [-6.188049, 53.426514], [-6.185303, 53.426514], [-6.183243, 53.425827], [-6.182556, 53.423767], [-6.183243, 53.421707], [-6.183929, 53.420334], [-6.182556, 53.418961], [-6.17981, 53.418274], [-6.174316, 53.418274], [-6.172256, 53.417587], [-6.170883, 53.413467], [-6.166763, 53.412094], [-6.164017, 53.409348], [-6.162643, 53.405228], [-6.158524, 53.403854], [-6.155777, 53.401108], [-6.15509, 53.399048], [-6.155777, 53.396988], [-6.158524, 53.394241], [-6.162643, 53.392868], [-6.16333, 53.390808], [-6.16333, 53.388062], [-6.162643, 53.386002], [-6.160583, 53.385315], [-6.157837, 53.385315], [-6.155777, 53.386002], [-6.154404, 53.387375], [-6.152344, 53.388062], [-6.144104, 53.388062], [-6.142044, 53.387375], [-6.141357, 53.385315], [-6.141357, 53.382568], [-6.142044, 53.380508], [-6.144791, 53.377762], [-6.146851, 53.377075], [-6.149597, 53.377075], [-6.151657, 53.376389], [-6.152344, 53.374329], [-6.152344, 53.371582], [-6.15303, 53.369522], [-6.15509, 53.368835], [-6.157837, 53.368835], [-6.159897, 53.368149], [-6.16127, 53.366776], [-6.16539, 53.365402], [-6.168137, 53.362656], [-6.168137, 53.361282], [-6.166763, 53.359909], [-6.166077, 53.357849], [-6.166077, 53.355103], [-6.166763, 53.353043], [-6.168823, 53.352356], [-6.177063, 53.352356], [-6.179123, 53.353043], [-6.180496, 53.354416], [-6.182556, 53.355103], [-6.185303, 53.355103], [-6.187363, 53.354416], [-6.188049, 53.352356], [-6.188049, 53.346863], [-6.188736, 53.344803], [-6.190109, 53.34343], [-6.190796, 53.34137], [-6.190796, 53.338623], [-6.191483, 53.336563], [-6.193542, 53.335876], [-6.201782, 53.335876], [-6.203842, 53.33519], [-6.203842, 53.333817], [-6.202469, 53.332443], [-6.201096, 53.328323], [-6.199722, 53.32695], [-6.199036, 53.32489], [-6.199036, 53.319397], [-6.198349, 53.317337], [-6.195602, 53.31459], [-6.191483, 53.313217], [-6.190109, 53.311844], [-6.185989, 53.310471], [-6.185303, 53.308411], [-6.185303, 53.305664], [-6.185989, 53.303604], [-6.188049, 53.302917], [-6.190796, 53.302917], [-6.192856, 53.302231], [-6.194229, 53.298111], [-6.195602, 53.296738], [-6.196976, 53.292618], [-6.199036, 53.291931], [-6.207275, 53.291931], [-6.209335, 53.292618], [-6.210709, 53.293991], [-6.212769, 53.294678], [-6.221008, 53.294678], [-6.223068, 53.293991], [-6.224442, 53.289871], [-6.232681, 53.281631], [-6.236801, 53.280258], [-6.237488, 53.278198], [-6.236801, 53.276138], [-6.234741, 53.275452], [-6.210022, 53.275452], [-6.207962, 53.274765], [-6.206589, 53.273392], [-6.202469, 53.272018], [-6.201782, 53.269958], [-6.201782, 53.267212], [-6.202469, 53.265152], [-6.204529, 53.264465], [-6.210022, 53.264465], [-6.212082, 53.265152], [-6.213455, 53.266525], [-6.215515, 53.267212], [-6.237488, 53.267212], [-6.239548, 53.266525], [-6.240921, 53.265152], [-6.242981, 53.264465], [-6.245728, 53.264465], [-6.247787, 53.263779], [-6.249161, 53.262405], [-6.251221, 53.261719], [-6.25946, 53.261719], [-6.26152, 53.262405], [-6.262894, 53.263779], [-6.264954, 53.264465], [-6.270447, 53.264465], [-6.272507, 53.263779], [-6.27388, 53.262405], [-6.27594, 53.261719], [-6.289673, 53.261719], [-6.291733, 53.262405], [-6.293106, 53.263779], [-6.295166, 53.264465], [-6.300659, 53.264465], [-6.302719, 53.265152], [-6.304092, 53.266525], [-6.306152, 53.267212], [-6.314392, 53.267212], [-6.316452, 53.266525], [-6.316452, 53.265152], [-6.312332, 53.263779], [-6.311646, 53.261719], [-6.312332, 53.259659], [-6.315079, 53.256912], [-6.317139, 53.256226], [-6.322632, 53.256226], [-6.324692, 53.256912], [-6.328812, 53.261032], [-6.332932, 53.262405], [-6.334305, 53.263779], [-6.336365, 53.264465], [-6.347351, 53.264465], [-6.349411, 53.265152], [-6.350784, 53.266525], [-6.352158, 53.266525], [-6.353531, 53.265152], [-6.355591, 53.264465], [-6.363831, 53.264465], [-6.365891, 53.265152], [-6.366577, 53.267212], [-6.366577, 53.269958], [-6.367264, 53.272018], [-6.369324, 53.272705], [-6.377563, 53.272705], [-6.379623, 53.273392], [-6.380997, 53.277512], [-6.383057, 53.278198], [-6.385117, 53.277512], [-6.38649, 53.276138], [-6.38855, 53.275452], [-6.405029, 53.275452], [-6.407089, 53.276138], [-6.408463, 53.276825], [-6.409836, 53.275452], [-6.411209, 53.273392], [-6.413269, 53.272705], [-6.421509, 53.272705], [-6.423569, 53.273392], [-6.424942, 53.274765], [-6.426315, 53.274765], [-6.427689, 53.270645], [-6.429749, 53.269958], [-6.440735, 53.269958], [-6.442795, 53.269272], [-6.444168, 53.267899], [-6.446228, 53.267212], [-6.451721, 53.267212], [-6.453781, 53.267899], [-6.457901, 53.272018], [-6.459961, 53.273392], [-6.462708, 53.274765], [-6.465454, 53.275452], [-6.468201, 53.275452], [-6.470261, 53.274765], [-6.471634, 53.273392], [-6.475754, 53.272018], [-6.477127, 53.270645], [-6.4785, 53.270645], [-6.479874, 53.272018], [-6.481934, 53.272705], [-6.498413, 53.272705], [-6.500473, 53.272018], [-6.501846, 53.270645], [-6.503906, 53.269958], [-6.506653, 53.269958], [-6.508713, 53.269272], [-6.510086, 53.267899], [-6.514206, 53.266525], [-6.515579, 53.265152], [-6.517639, 53.264465], [-6.523132, 53.264465], [-6.525192, 53.265152], [-6.525879, 53.267212], [-6.525879, 53.269958], [-6.525192, 53.272018], [-6.521072, 53.273392], [-6.519699, 53.274765], [-6.515579, 53.276138], [-6.514206, 53.277512], [-6.510086, 53.278885], [-6.508713, 53.280258], [-6.506653, 53.280945], [-6.498413, 53.280945], [-6.496353, 53.281631], [-6.49498, 53.283005], [-6.49292, 53.283691], [-6.487427, 53.283691], [-6.485367, 53.284378], [-6.483994, 53.285751], [-6.481934, 53.286438], [-6.47644, 53.286438], [-6.47438, 53.287125], [-6.473694, 53.289185], [-6.473694, 53.291931], [-6.473007, 53.293991], [-6.470947, 53.294678], [-6.465454, 53.294678], [-6.463394, 53.293991], [-6.462021, 53.292618], [-6.459961, 53.291931], [-6.454468, 53.291931], [-6.452408, 53.292618], [-6.451035, 53.293991], [-6.446915, 53.295364], [-6.445541, 53.299484], [-6.444168, 53.300858], [-6.444168, 53.302231], [-6.446228, 53.302917], [-6.448975, 53.302917], [-6.451035, 53.303604], [-6.452408, 53.307724], [-6.454468, 53.308411], [-6.459961, 53.308411], [-6.462021, 53.307724], [-6.463394, 53.306351], [-6.465454, 53.305664], [-6.473694, 53.305664], [-6.475754, 53.306351], [-6.477127, 53.310471], [-6.479187, 53.311157], [-6.481247, 53.310471], [-6.48262, 53.309097], [-6.48468, 53.308411], [-6.490173, 53.308411], [-6.492233, 53.309097], [-6.49498, 53.311844], [-6.495667, 53.313904], [-6.49498, 53.315964], [-6.49086, 53.317337], [-6.48674, 53.321457], [-6.48468, 53.322144], [-6.473694, 53.322144], [-6.471634, 53.32283], [-6.467514, 53.32695], [-6.463394, 53.328323], [-6.463394, 53.329697], [-6.467514, 53.33107], [-6.468887, 53.332443], [-6.470947, 53.33313], [-6.47644, 53.33313], [-6.4785, 53.333817], [-6.479874, 53.33519], [-6.483994, 53.336563], [-6.485367, 53.337936], [-6.48674, 53.337936], [-6.49086, 53.333817], [-6.49498, 53.332443], [-6.495667, 53.330383], [-6.495667, 53.327637], [-6.496353, 53.325577], [-6.4991, 53.32283], [-6.50116, 53.322144], [-6.514893, 53.322144], [-6.516953, 53.321457], [-6.518326, 53.320084], [-6.520386, 53.319397], [-6.523132, 53.319397], [-6.525192, 53.320084], [-6.527939, 53.32283], [-6.528625, 53.32489], [-6.527939, 53.32695], [-6.523819, 53.33107], [-6.523132, 53.33313], [-6.523819, 53.33519], [-6.525879, 53.335876], [-6.527939, 53.33519], [-6.529312, 53.333817], [-6.531372, 53.33313], [-6.542358, 53.33313], [-6.544418, 53.333817], [-6.545105, 53.335876], [-6.545105, 53.338623], [-6.545792, 53.340683], [-6.548538, 53.34343], [-6.550598, 53.344116], [-6.553345, 53.344116], [-6.555405, 53.344803], [-6.556778, 53.348923], [-6.560898, 53.353043], [-6.562271, 53.357162], [-6.564331, 53.357849], [-6.569824, 53.357849], [-6.571884, 53.358536], [-6.573257, 53.359909], [-6.575317, 53.360596], [-6.583557, 53.360596], [-6.585617, 53.359909], [-6.58699, 53.355789], [-6.59111, 53.351669], [-6.592484, 53.347549], [-6.59523, 53.344803], [-6.59729, 53.344116], [-6.600037, 53.344116], [-6.602097, 53.344803], [-6.604843, 53.347549], [-6.60553, 53.349609], [-6.60553, 53.352356], [-6.604843, 53.354416], [-6.600723, 53.358536], [-6.600037, 53.360596], [-6.600723, 53.362656], [-6.60347, 53.365402], [-6.60553, 53.366089], [-6.61377, 53.366089], [-6.615829, 53.366776], [-6.617203, 53.368149], [-6.619263, 53.368835], [-6.624756, 53.368835], [-6.626816, 53.369522], [-6.628189, 53.370895], [-6.630249, 53.371582], [-6.635742, 53.371582], [-6.637802, 53.372269], [-6.639175, 53.373642], [-6.641235, 53.374329], [-6.643982, 53.374329], [-6.646042, 53.375015], [-6.646729, 53.377075], [-6.646729, 53.379822], [-6.646385, 53.381882], [-6.645355, 53.382568], [-6.643639, 53.382568]]], "type": "Polygon"}, "properties": {"range": {"type": "time", "value": 1500}}, "type": "Feature"}], "type": "FeatureCollection"}, "type": "GeoJSON"}
To specify polygons without changing the data in your question, you need to specify geometry values in dictionary form.
import folium
latitude = 53.372
longitude = -6.49
# Create the map
m = folium.Map(location=[latitude, longitude], zoom_start=10)
# Add a marker to the map
folium.Marker(
[latitude, longitude]
).add_to(m)
# Add the layer
folium.GeoJson(data=value['data']['features'][0]['geometry'], name="geojson").add_to(m)
folium.LayerControl().add_to(m)
m
I want to create a table that looks like this:
So far I have a table I created to get the value counts but I need help with creating a table that calculates the total value of row 0 and 1. I'm using this dataset: https://github.com/fivethirtyeight/data/tree/master/bob-ross
Code:
ross = bobross[['Apple frame', 'Aurora borealis', 'Barn', 'Beach', 'Boat',
'Bridge', 'Building', 'Bushes', 'Cabin', 'Cactus',
'Circle frame', 'Cirrus clouds', 'Cliff', 'Clouds',
'Coniferous tree', 'Cumulus clouds', 'Decidious tree',
'Diane andre', 'Dock', 'Double oval frame', 'Farm',
'Fence', 'Fire', 'Florida frame', 'Flowers', 'Fog',
'Framed', 'Grass', 'Guest', 'Half circle frame',
'Half oval frame', 'Hills', 'Lake', 'Lakes', 'Lighthouse',
'Mill', 'Moon', 'At least one mountain', 'At least two mountains',
'Nighttime', 'Ocean', 'Oval frame', 'Palm trees', 'Path',
'Person', 'Portrait', 'Rectangle 3d frame', 'Rectangular frame',
'River or stream', 'Rocks', 'Seashell frame', 'Snow',
'Snow-covered mountain', 'Split frame', 'Steve ross',
'Man-made structure', 'Sun', 'Tomb frame', 'At least one tree',
'At least two trees', 'Triple frame', 'Waterfall', 'Waves',
'Windmill', 'Window frame', 'Winter setting', 'Wood framed']].apply(pd.Series.value_counts)
ross
IIUC,
import pandas as pd
import numpy as np
df = pd.read_csv('https://raw.githubusercontent.com/fivethirtyeight/data/master/bob-ross/elements-by-episode.csv')
dfi = df.set_index(['EPISODE', 'TITLE'])
(dfi.sum()/np.sum(dfi.to_numpy()))
Output:
APPLE_FRAME 0.000310
AURORA_BOREALIS 0.000621
BARN 0.005278
BEACH 0.008382
BOAT 0.000621
...
WAVES 0.010556
WINDMILL 0.000310
WINDOW_FRAME 0.000310
WINTER 0.021422
WOOD_FRAMED 0.000310
Length: 67, dtype: float64
I am not well-versed in python, and I'm sure there is a simple solution to this (although, I have looked). I got this code from an lpdaac tutorial.
My input is a NETCDF4 file downloaded from MODIS satellite. Printing the metadata of the file returns the variables
file_in = Dataset(file_list[0], 'r', format = 'NETCDF4')
#print metadata
list(file_in.variables)
Out[19]: ['crs', 'time', 'lat', 'lon', '_1_km_16_days_EVI', '_1_km_16_days_VI_Quality']
I want to convert the time variable to date format, and then only select 1 date from each year. Here is the code to convert to date format:
from netCDF4 import num2date
times = file_in.variables["time"] #import time variables
dates = num2date(times[:], times.units) #get the time info
dates = [date.strftime("%Y-%m-%d") for date in dates] #get the list of datetime
print(dates)
The dates are as follows:
['2000-06-25', '2000-07-11', '2000-07-27', '2000-08-12', '2000-08-28', '2000-09-13', '2000-09-29', '2000-10-15', '2000-10-31', '2000-11-16', '2000-12-02', '2000-12-18', '2001-01-01', '2001-01-17', '2001-02-02', '2001-02-18', '2001-03-06', '2001-03-22', '2001-04-07', '2001-04-23', '2001-05-09', '2001-05-25', '2001-06-10', '2001-06-26', '2001-07-12', '2001-07-28', '2001-08-13', '2001-08-29', '2001-09-14', '2001-09-30', '2001-10-16', '2001-11-01', '2001-11-17', '2001-12-03', '2001-12-19', '2002-01-01', '2002-01-17', '2002-02-02', '2002-02-18', '2002-03-06', '2002-03-22', '2002-04-07', '2002-04-23', '2002-05-09', '2002-05-25', '2002-06-10', '2002-06-26', '2002-07-12', '2002-07-28', '2002-08-13', '2002-08-29', '2002-09-14', '2002-09-30', '2002-10-16', '2002-11-01', '2002-11-17', '2002-12-03', '2002-12-19', '2003-01-01', '2003-01-17', '2003-02-02', '2003-02-18', '2003-03-06', '2003-03-22', '2003-04-07', '2003-04-23', '2003-05-09', '2003-05-25', '2003-06-10', '2003-06-26', '2003-07-12', '2003-07-28', '2003-08-13', '2003-08-29', '2003-09-14', '2003-09-30', '2003-10-16', '2003-11-01', '2003-11-17', '2003-12-03', '2003-12-19', '2004-01-01', '2004-01-17', '2004-02-02', '2004-02-18', '2004-03-05', '2004-03-21', '2004-04-06', '2004-04-22', '2004-05-08', '2004-05-24', '2004-06-09', '2004-06-25', '2004-07-11', '2004-07-27', '2004-08-12', '2004-08-28', '2004-09-13', '2004-09-29', '2004-10-15', '2004-10-31', '2004-11-16', '2004-12-02', '2004-12-18', '2005-01-01', '2005-01-17', '2005-02-02', '2005-02-18', '2005-03-06', '2005-03-22', '2005-04-07', '2005-04-23', '2005-05-09', '2005-05-25', '2005-06-10', '2005-06-26', '2005-07-12', '2005-07-28', '2005-08-13', '2005-08-29', '2005-09-14', '2005-09-30', '2005-10-16', '2005-11-01', '2005-11-17', '2005-12-03', '2005-12-19', '2006-01-01', '2006-01-17', '2006-02-02', '2006-02-18', '2006-03-06', '2006-03-22', '2006-04-07', '2006-04-23', '2006-05-09', '2006-05-25', '2006-06-10', '2006-06-26', '2006-07-12', '2006-07-28', '2006-08-13', '2006-08-29', '2006-09-14', '2006-09-30', '2006-10-16', '2006-11-01', '2006-11-17', '2006-12-03', '2006-12-19', '2007-01-01', '2007-01-17', '2007-02-02', '2007-02-18', '2007-03-06', '2007-03-22', '2007-04-07', '2007-04-23', '2007-05-09', '2007-05-25', '2007-06-10', '2007-06-26', '2007-07-12', '2007-07-28', '2007-08-13', '2007-08-29', '2007-09-14', '2007-09-30', '2007-10-16', '2007-11-01', '2007-11-17', '2007-12-03', '2007-12-19', '2008-01-01', '2008-01-17', '2008-02-02', '2008-02-18', '2008-03-05', '2008-03-21', '2008-04-06', '2008-04-22', '2008-05-08', '2008-05-24', '2008-06-09', '2008-06-25', '2008-07-11', '2008-07-27', '2008-08-12', '2008-08-28', '2008-09-13', '2008-09-29', '2008-10-15', '2008-10-31', '2008-11-16', '2008-12-02', '2008-12-18', '2009-01-01', '2009-01-17', '2009-02-02', '2009-02-18', '2009-03-06', '2009-03-22', '2009-04-07', '2009-04-23', '2009-05-09', '2009-05-25', '2009-06-10', '2009-06-26', '2009-07-12', '2009-07-28', '2009-08-13', '2009-08-29', '2009-09-14', '2009-09-30', '2009-10-16', '2009-11-01', '2009-11-17', '2009-12-03', '2009-12-19', '2010-01-01', '2010-01-17', '2010-02-02', '2010-02-18', '2010-03-06', '2010-03-22', '2010-04-07', '2010-04-23', '2010-05-09', '2010-05-25', '2010-06-10', '2010-06-26', '2010-07-12', '2010-07-28', '2010-08-13', '2010-08-29', '2010-09-14', '2010-09-30', '2010-10-16', '2010-11-01', '2010-11-17', '2010-12-03', '2010-12-19', '2011-01-01', '2011-01-17', '2011-02-02', '2011-02-18', '2011-03-06', '2011-03-22', '2011-04-07', '2011-04-23', '2011-05-09', '2011-05-25', '2011-06-10', '2011-06-26', '2011-07-12', '2011-07-28', '2011-08-13', '2011-08-29', '2011-09-14', '2011-09-30', '2011-10-16', '2011-11-01', '2011-11-17', '2011-12-03', '2011-12-19', '2012-01-01', '2012-01-17', '2012-02-02', '2012-02-18', '2012-03-05', '2012-03-21', '2012-04-06', '2012-04-22', '2012-05-08', '2012-05-24', '2012-06-09', '2012-06-25', '2012-07-11', '2012-07-27', '2012-08-12', '2012-08-28', '2012-09-13', '2012-09-29', '2012-10-15', '2012-10-31', '2012-11-16', '2012-12-02', '2012-12-18', '2013-01-01', '2013-01-17', '2013-02-02', '2013-02-18', '2013-03-06', '2013-03-22', '2013-04-07', '2013-04-23', '2013-05-09', '2013-05-25', '2013-06-10', '2013-06-26', '2013-07-12', '2013-07-28', '2013-08-13', '2013-08-29', '2013-09-14', '2013-09-30', '2013-10-16', '2013-11-01', '2013-11-17', '2013-12-03', '2013-12-19', '2014-01-01', '2014-01-17', '2014-02-02', '2014-02-18', '2014-03-06', '2014-03-22', '2014-04-07', '2014-04-23', '2014-05-09', '2014-05-25', '2014-06-10', '2014-06-26', '2014-07-12', '2014-07-28', '2014-08-13', '2014-08-29', '2014-09-14', '2014-09-30', '2014-10-16', '2014-11-01', '2014-11-17', '2014-12-03', '2014-12-19', '2015-01-01', '2015-01-17', '2015-02-02', '2015-02-18', '2015-03-06', '2015-03-22', '2015-04-07', '2015-04-23', '2015-05-09', '2015-05-25', '2015-06-10', '2015-06-26', '2015-07-12', '2015-07-28', '2015-08-13', '2015-08-29', '2015-09-14', '2015-09-30', '2015-10-16', '2015-11-01', '2015-11-17', '2015-12-03', '2015-12-19', '2016-01-01', '2016-01-17', '2016-02-02', '2016-02-18', '2016-03-05', '2016-03-21', '2016-04-06', '2016-04-22', '2016-05-08', '2016-05-24', '2016-06-09', '2016-06-25', '2016-07-11', '2016-07-27', '2016-08-12', '2016-08-28', '2016-09-13', '2016-09-29', '2016-10-15', '2016-10-31', '2016-11-16', '2016-12-02', '2016-12-18', '2017-01-01', '2017-01-17', '2017-02-02', '2017-02-18', '2017-03-06', '2017-03-22', '2017-04-07', '2017-04-23', '2017-05-09', '2017-05-25', '2017-06-10', '2017-06-26', '2017-07-12', '2017-07-28', '2017-08-13', '2017-08-29', '2017-09-14', '2017-09-30', '2017-10-16', '2017-11-01', '2017-11-17', '2017-12-03', '2017-12-19', '2018-01-01', '2018-01-17', '2018-02-02', '2018-02-18', '2018-03-06', '2018-03-22', '2018-04-07', '2018-04-23', '2018-05-09', '2018-05-25', '2018-06-10', '2018-06-26', '2018-07-12', '2018-07-28', '2018-08-13', '2018-08-29', '2018-09-14', '2018-09-30', '2018-10-16', '2018-11-01', '2018-11-17', '2018-12-03', '2018-12-19', '2019-01-01', '2019-01-17', '2019-02-02', '2019-02-18', '2019-03-06', '2019-03-22', '2019-04-07', '2019-04-23', '2019-05-09', '2019-05-25', '2019-06-10', '2019-06-26', '2019-07-12', '2019-07-28', '2019-08-13', '2019-08-29', '2019-09-14', '2019-09-30', '2019-10-16', '2019-11-01', '2019-11-17', '2019-12-03', '2019-12-19', '2020-01-01', '2020-01-17', '2020-02-02', '2020-02-18', '2020-03-05', '2020-03-21', '2020-04-06', '2020-04-22', '2020-05-08', '2020-05-24', '2020-06-09', '2020-06-25', '2020-07-11', '2020-07-27']
And these are the dates I want in the data frame:
dates = ['2000-07-11', '2001-07-12', '2002-07-12', '2003-07-12', '2004-07-11',
'2005-07-12', '2006-07-12', '2007-07-12', '2008-07-11', '2009-07-12',
'2010-07-12', '2011-07-12', '2012-07-11', '2013-07-12', '2014-07-12',
'2015-07-12', '2016-07-11', '2017-07-12', '2018-07-12', '2019-07-12',
'2020-07-11']
I tried just defining a new dates data frame, but I think that caused problems for me later in the code, so I would like to just subset the first dates data frame if there is an easy way to do it.
Thank you for your help
I'm trying to receive stock data for about 1000 stocks, to speed up the process I'm using multiprocessing, unfortunately due to the large amount of stock data I'm trying to receive python as a whole just crashes.
Is there a way to use multiprocessing without python crashing, I understand it would still take some time to do all of the 1000 stocks, but all I need is to do this process as fast as possible.
import threading
import yfinance as yf
from multiprocessing import Process
database = {}
mylock = threading.RLock()
stocks = ['AAU', 'ABEO', 'ABEV', 'ABIO', 'ABUS', 'ACCO', 'ACER', 'ACIU', 'ACOR', 'ACRX', 'ACST', 'ACTG', 'ADAP', 'ADIL', 'ADMA', 'ADMP', 'ADT', 'ADTX', 'ADXS', 'AEG', 'AEHL', 'AEHR', 'AEMD', 'AESE', 'AEY', 'AEZS', 'AFIN', 'AFMD', 'AGEN', 'AGI', 'AGRO', 'AGRX', 'AGS', 'AGTC', 'AHPI', 'AHT', 'AIHS', 'AIKI', 'AIM', 'AINC', 'AIRI', 'AIV', 'AKBA', 'AKER', 'AKTX', 'ALNA', 'ALRN', 'ALSK', 'AM', 'AMBO', 'AMC', 'AMPE', 'AMPY', 'AMRN', 'AMRS', 'AMRX', 'AMTX', 'ANCN', 'ANH', 'ANIX', 'ANPC', 'ANTE', 'ANY', 'APDN', 'APM', 'APRE', 'APRN', 'APTO', 'APTS', 'APTX', 'APWC', 'AQMS', 'AQST', 'AR', 'ARAY', 'ARC', 'ARCO', 'ARDX', 'AREC', 'ARKO', 'ARLO', 'ARLP', 'AROC', 'ARPO', 'ARTL', 'ASC', 'ASLN', 'ASM', 'ASMB', 'ASRT', 'ASTC', 'ASX', 'ATAX', 'ATHE', 'ATHX', 'ATIF', 'ATNF', 'ATNM', 'ATOS', 'ATRS', 'ATXI', 'AUMN', 'AUTO', 'AUVI', 'AUY', 'AVCO', 'AVDL', 'AVEO', 'AVGR', 'AVXL', 'AWH', 'AWX', 'AXAS', 'AXL', 'AXU', 'AYRO', 'AYTU', 'AZRX', 'BBAR', 'BBD', 'BBGI', 'BBI', 'BBIG', 'BBVA', 'BBW', 'BCDA', 'BCLI', 'BCRX', 'BCS', 'BDR', 'BDSI', 'BEST', 'BGCP', 'BGI', 'BHAT', 'BHR', 'BHTG', 'BIMI', 'BIOC', 'BIOL', 'BKCC', 'BKD', 'BKEP', 'BKYI', 'BLCM', 'BLCT', 'BLIN', 'BLRX', 'BLU', 'BMRA', 'BNED', 'BNTC', 'BORR', 'BOXL', 'BPT', 'BPTH', 'BQ', 'BREZR', 'BRFS', 'BRN', 'BRPAR', 'BRQS', 'BRY', 'BSBR', 'BSGM', 'BSM', 'BSMX', 'BTG', 'BTU', 'BVXV', 'BW', 'BWEN', 'BXRX', 'BYFC', 'CAAP', 'CAAS', 'CALA', 'CAN', 'CANF', 'CAPR', 'CARV', 'CASA', 'CASI', 'CATB', 'CBAT', 'CBAY', 'CBIO', 'CBLI', 'CCO', 'CCRC', 'CCRN', 'CDE', 'CDEV', 'CDTX', 'CDXC', 'CEI', 'CEIX', 'CEMI', 'CERC', 'CERS', 'CETX', 'CFMS', 'CGIX', 'CHEK', 'CHMA', 'CHNR', 'CHRA', 'CHS', 'CHU', 'CIDM', 'CIG', 'CIO', 'CJJD', 'CKPT', 'CLBS', 'CLIR', 'CLNC', 'CLNY', 'CLPS', 'CLRB', 'CLS', 'CLSD', 'CLSN', 'CLVR', 'CLVS', 'CLXT', 'CMCM', 'CMO', 'CMRE', 'CMRX', 'CNDT', 'CNET', 'CNFR', 'CNSL', 'CNSP', 'CNTY', 'COCP', 'COGT', 'COMS', 'CORR', 'CPG', 'CPHI', 'CPRX', 'CPSH', 'CRBP', 'CREG', 'CREX', 'CRIS', 'CRK', 'CRKN', 'CRMD', 'CRNT', 'CSCW', 'CSLT', 'CSPR', 'CTEK', 'CTIB', 'CTIC', 'CTK', 'CTMX', 'CTRM', 'CTSO', 'CTXR', 'CVE', 'CVGI', 'CWBR', 'CX', 'CXW', 'CYCC', 'CYCN', 'CYRN', 'CYTH', 'DARE', 'DBVT', 'DFFN', 'DGLY', 'DHC', 'DHT', 'DLPN', 'DNK', 'DNN', 'DNOW', 'DOGZ', 'DPW', 'DRH', 'DRRX', 'DRTT', 'DS', 'DSKE', 'DSS', 'DSSI', 'DSX', 'DTEA', 'DTSS', 'DUO', 'DVAX', 'DXF', 'DXLG', 'DYNT', 'EARS', 'EBON', 'EBR', 'ECOR', 'EDSA', 'EGY', 'EIGR', 'ELVT', 'ELYS', 'EMAN', 'EMKR', 'EMX', 'ENBL', 'ENDP', 'ENG', 'ENIA', 'ENIC', 'ENLC', 'ENSV', 'ENTX', 'ENVB', 'ENZ', 'EOLS', 'EQ', 'EQX', 'ERF', 'ERJ', 'ESGC', 'ESTE', 'ET', 'ETM', 'ETRN', 'ETTX', 'EURN', 'EVC', 'EVFM', 'EVGN', 'EVK', 'EVOK', 'EXK', 'EXPR', 'EXTR', 'EYEG', 'EYES', 'EZGO', 'EZPW', 'FAMI', 'FBIO', 'FBP', 'FENG', 'FI', 'FINV', 'FLDM', 'FLMN', 'FLNT', 'FLY', 'FORD', 'FPAY', 'FRBK', 'FRO', 'FRSX', 'FSM', 'FSP', 'FTEK', 'FTFT', 'FTK', 'FURY', 'GAU', 'GBS', 'GCI', 'GEL', 'GEN', 'GENE', 'GEO', 'GERN', 'GFI', 'GGAL', 'GGB', 'GHSI', 'GLBS', 'GLDG', 'GLG', 'GLOG', 'GLOP', 'GLUU', 'GLYC', 'GMBL', 'GMDA', 'GMLP', 'GNCA', 'GNK', 'GNLN', 'GNPX', 'GNUS', 'GNW', 'GOGL', 'GOL', 'GORO', 'GOSS', 'GOVX', 'GPL', 'GPMT', 'GPRO', 'GRIL', 'GRNQ', 'GSAT', 'GSKY', 'GSM', 'GSS', 'GSV', 'GTE', 'GTEC', 'GTT', 'GV', 'GVP', 'HAPP', 'HBM', 'HCDI', 'HCHC', 'HDSN', 'HEPA', 'HEXO', 'HGSH', 'HIL', 'HIMX', 'HJLI', 'HL', 'HLIT', 'HLX', 'HMHC', 'HMY', 'HNRG', 'HOFV', 'HOTH', 'HSTO', 'HT', 'HTBX', 'HUGE', 'HUSA', 'HUSN', 'HX', 'HYRE', 'IAG', 'IBIO', 'ICD', 'ICON', 'ID', 'IDEX', 'IDRA', 'IFMK', 'IFRX', 'IGC', 'IHT', 'IKT', 'IMAC', 'IMGN', 'IMMP', 'IMTE', 'IMV', 'INDO', 'INFI', 'ING', 'INN', 'INOD', 'INPX', 'INUV', 'IO', 'IPDN', 'IRIX', 'ISEE', 'ISIG', 'ISR', 'ITP', 'ITRM', 'ITUB', 'IVR', 'IZEA', 'JAGX', 'JE', 'JFIN', 'JFU', 'JG', 'JIH.W', 'JILL', 'JOB', 'JUPW', 'KALA', 'KBNT', 'KBSF', 'KDMN', 'KERN', 'KGC', 'KIN', 'KIQ', 'KMPH', 'KNDI', 'KODK', 'KOPN', 'KOS', 'KRKR', 'KRMD', 'KTRA', 'KUKE', 'KXIN', 'KZIA', 'LCI', 'LCTX', 'LEAF', 'LEE', 'LGHL', 'LIFE', 'LITB', 'LIVX', 'LIZI', 'LJPC', 'LKCO', 'LLIT', 'LLNW', 'LMFA', 'LMNL', 'LODE', 'LOMA', 'LPCN', 'LPTH', 'LPTX', 'LQDA', 'LSEA', 'LTBR', 'LTRPA', 'LX', 'LXRX', 'LYG', 'MACK', 'MARK', 'MBI', 'MBII', 'MBIO', 'MBRX', 'MBT', 'MCEP', 'MCF', 'MDGS', 'MDXG', 'MEIP', 'MESA', 'MESO', 'METX', 'MFA', 'MFG', 'MFGP', 'MFH', 'MGI', 'MGY', 'MHLD', 'MICT', 'MIN', 'MIND', 'MITO', 'MITT', 'MKD', 'MKGI', 'MLND', 'MLSS', 'MNKD', 'MOGO', 'MOGU', 'MOHO', 'MOSY', 'MOTS', 'MOXC', 'MPLN', 'MRC', 'MREO', 'MRIN', 'MRKR', 'MRO', 'MSN', 'MTA', 'MTC', 'MTL', 'MTNB', 'MTP', 'MTSL', 'MUFG', 'MUX', 'MVIS', 'MYSZ', 'MYT', 'NAK', 'NAKD', 'NAOV', 'NAT', 'NAVB', 'NBEV', 'NBRV', 'NBSE', 'NBY', 'NCMI', 'NCNA', 'NDRA', 'NEOS', 'NEPT', 'NERV', 'NES', 'NEW', 'NEX', 'NG', 'NGD', 'NGL', 'NH', 'NLY', 'NMCI', 'NMRK', 'NMTR', 'NNVC', 'NOK', 'NOVN', 'NR', 'NRZ', 'NSCO', 'NSPR', 'NTEC', 'NTN', 'NURO', 'NVCN', 'NVIV', 'NWG', 'NXE', 'NXTD', 'NYMT', 'OBLG', 'OBLN', 'OBSV', 'OCG', 'OCGN', 'OCSL', 'OCX', 'OEG', 'OGEN', 'OGI', 'OIBR.C', 'OII', 'OIIM', 'OIS', 'ONCT', 'ONCY', 'ONTX', 'OPGN', 'OPK', 'OPTN', 'OPTT', 'ORBC', 'ORC', 'ORMP', 'ORN', 'ORTX', 'OSMT', 'OSW', 'OTIC', 'OTLK', 'OVID', 'OXBR', 'OXLC', 'PAA', 'PAE', 'PAGP', 'PAVM', 'PAYS', 'PBF', 'PBI', 'PDSB', 'PED', 'PEI', 'PEIX', 'PFMT', 'PGEN', 'PGRE', 'PHAS', 'PHIO', 'PHUN', 'PIRS', 'PIXY', 'PLAG', 'PLG', 'PLIN', 'PLM', 'PLYA', 'PNNT', 'POAI', 'POWW', 'PPBT', 'PPR', 'PPSI', 'PPT', 'PROG', 'PRPO', 'PRQR', 'PRTK', 'PRTY', 'PSEC', 'PSTI', 'PSTV', 'PT', 'PTE', 'PTEN', 'PTMN', 'PTN', 'PULM', 'PUMP', 'PVL', 'PXLW', 'PXS', 'QD', 'QEP', 'QIWI', 'QLGN', 'QLI', 'QTNT', 'QTT', 'QUAD', 'QUOT', 'RAIL', 'RAVE', 'RBBN', 'RCON', 'RDHL', 'REED', 'REFR', 'REI', 'REPH', 'RES', 'RESN', 'RETO', 'RFP', 'RGLS', 'RGS', 'RHE', 'RIBT', 'RIG', 'RIGL', 'RKDA', 'RLH', 'RMED', 'RMTI', 'RNWK', 'RPAI', 'RPT', 'RRC', 'RRD', 'RTLR', 'RUHN', 'RWLK', 'RWT', 'RYAM', 'SALM', 'SAN', 'SAND', 'SB', 'SBBP', 'SBS', 'SCKT', 'SCOR', 'SCYX', 'SD', 'SDPI', 'SEAC', 'SEEL', 'SELB', 'SENS', 'SESN', 'SFET', 'SFL', 'SFT', 'SGBX', 'SGLB', 'SGOC', 'SHIP', 'SID', 'SIEN', 'SIF', 'SIFY', 'SILV', 'SINO', 'SINT', 'SIOX', 'SIRI', 'SLCA', 'SLDB', 'SLGG', 'SLRX', 'SLS', 'SM', 'SMFG', 'SMSI', 'SMTS', 'SMTX', 'SNCA', 'SNCR', 'SND', 'SNDE', 'SNDL', 'SNES', 'SNGX', 'SNMP', 'SNOA', 'SNR', 'SNSS', 'SOI', 'SOLO', 'SONM', 'SONN', 'SOS', 'SPCB', 'SPPI', 'SQFT', 'SQNS', 'SREV', 'SRGA', 'SSL', 'STAF', 'STCN', 'STON', 'STSA', 'SUP', 'SUPV', 'SVM', 'SVRA', 'SWN', 'SXC', 'SXTC', 'SYBX', 'SYN', 'SYPR', 'TACO', 'TALO', 'TANH', 'TAOP', 'TAST', 'TAT', 'TATT', 'TBLT', 'TCCO', 'TCDA', 'TCON', 'TEDU', 'TEF', 'TELL', 'TENX', 'TEO', 'TGA', 'TGB', 'TGC', 'THM', 'THMO', 'TK', 'TKAT', 'TKC', 'TLGT', 'TLMD', 'TLSA', 'TLYS', 'TMBR', 'TMDI', 'TMQ', 'TMST', 'TNAV', 'TNXP', 'TOPS', 'TOUR', 'TPRE', 'TRCH', 'TRIB', 'TRIT', 'TRST', 'TRUE', 'TRVG', 'TRVN', 'TRX', 'TRXC', 'TTI', 'TTNP', 'TTOO', 'TUSK', 'TV', 'TWI', 'TWO', 'TXMD', 'TYME', 'UAMY', 'UBX', 'UEC', 'UEPS', 'UGP', 'UMC', 'UONE', 'UONEK', 'URG', 'USAS', 'USAT', 'USEG', 'USIO', 'USWS', 'USX', 'UTSI', 'UUUU', 'UWMC', 'UXIN', 'VBIV', 'VBLT', 'VCNX', 'VEDL', 'VEON', 'VERB', 'VERO', 'VERU', 'VET', 'VGZ', 'VHC', 'VIOT', 'VIRI', 'VISL', 'VIV', 'VIVE', 'VKTX', 'VNTR', 'VRA', 'VRAY', 'VSTM', 'VTGN', 'VTNR', 'VTVT', 'VVOS', 'VXRT', 'VYGR', 'VYNE', 'WATT', 'WEI', 'WETF', 'WIMI', 'WISA', 'WIT', 'WKEY', 'WMC', 'WORX', 'WPRT', 'WPX', 'WRAP', 'WRN', 'WSR', 'WTER', 'WTI', 'WTRH', 'WTTR', 'WVE', 'WWR', 'XAIR', 'XAN', 'XBIO', 'XCUR', 'XELA', 'XELB', 'XERS', 'XNET', 'XPL', 'XSPA', 'XXII', 'YCBD', 'YGYI', 'YJ', 'YPF', 'YRCW', 'YTRA', 'YVR', 'ZAGG', 'ZIOP', 'ZIXI', 'ZKIN', 'ZNGA', 'ZOM', 'ZSAN', 'ZVO', 'ZYNE', '']
class info():
def __init__(self, name):
self.name = name
self.goo()
def goo(self):
self.x = {'ticker':self.name, 'name': str(yf.Ticker(self.name).info['longName'])}
print(self.x, )
with mylock:
database[self.name] = self.x
def run_in_p():
proc = []
for name_s in stocks:
p = Process(target=info, args=(name_s, ))
p.start()
proc.append(p)
for p in proc:
p.join()
print(database)
if __name__ == "__main__":
run_in_p()
Edit:
Here's the error window that pops up
Along with this error window I get another error in the python console
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: Not Found
I'd like to offer a solution using a package called yahooquery. Disclaimer: I am the author of the package. You can get that same data in a few seconds with the following:
from yahooquery import Ticker
stocks = ['AAU', 'ABEO', 'ABEV', 'ABIO', 'ABUS', 'ACCO', 'ACER', 'ACIU', 'ACOR', 'ACRX', 'ACST', 'ACTG', 'ADAP', 'ADIL', 'ADMA', 'ADMP', 'ADT', 'ADTX', 'ADXS', 'AEG', 'AEHL', 'AEHR', 'AEMD', 'AESE', 'AEY', 'AEZS', 'AFIN', 'AFMD', 'AGEN', 'AGI', 'AGRO', 'AGRX', 'AGS', 'AGTC', 'AHPI', 'AHT', 'AIHS', 'AIKI', 'AIM', 'AINC', 'AIRI', 'AIV', 'AKBA', 'AKER', 'AKTX', 'ALNA', 'ALRN', 'ALSK', 'AM', 'AMBO', 'AMC', 'AMPE', 'AMPY', 'AMRN', 'AMRS', 'AMRX', 'AMTX', 'ANCN', 'ANH', 'ANIX', 'ANPC', 'ANTE', 'ANY', 'APDN', 'APM', 'APRE', 'APRN', 'APTO', 'APTS', 'APTX', 'APWC', 'AQMS', 'AQST', 'AR', 'ARAY', 'ARC', 'ARCO', 'ARDX', 'AREC', 'ARKO', 'ARLO', 'ARLP', 'AROC', 'ARPO', 'ARTL', 'ASC', 'ASLN', 'ASM', 'ASMB', 'ASRT', 'ASTC', 'ASX', 'ATAX', 'ATHE', 'ATHX', 'ATIF', 'ATNF', 'ATNM', 'ATOS', 'ATRS', 'ATXI', 'AUMN', 'AUTO', 'AUVI', 'AUY', 'AVCO', 'AVDL', 'AVEO', 'AVGR', 'AVXL', 'AWH', 'AWX', 'AXAS', 'AXL', 'AXU', 'AYRO', 'AYTU', 'AZRX', 'BBAR', 'BBD', 'BBGI', 'BBI', 'BBIG', 'BBVA', 'BBW', 'BCDA', 'BCLI', 'BCRX', 'BCS', 'BDR', 'BDSI', 'BEST', 'BGCP', 'BGI', 'BHAT', 'BHR', 'BHTG', 'BIMI', 'BIOC', 'BIOL', 'BKCC', 'BKD', 'BKEP', 'BKYI', 'BLCM', 'BLCT', 'BLIN', 'BLRX', 'BLU', 'BMRA', 'BNED', 'BNTC', 'BORR', 'BOXL', 'BPT', 'BPTH', 'BQ', 'BREZR', 'BRFS', 'BRN', 'BRPAR', 'BRQS', 'BRY', 'BSBR', 'BSGM', 'BSM', 'BSMX', 'BTG', 'BTU', 'BVXV', 'BW', 'BWEN', 'BXRX', 'BYFC', 'CAAP', 'CAAS', 'CALA', 'CAN', 'CANF', 'CAPR', 'CARV', 'CASA', 'CASI', 'CATB', 'CBAT', 'CBAY', 'CBIO', 'CBLI', 'CCO', 'CCRC', 'CCRN', 'CDE', 'CDEV', 'CDTX', 'CDXC', 'CEI', 'CEIX', 'CEMI', 'CERC', 'CERS', 'CETX', 'CFMS', 'CGIX', 'CHEK', 'CHMA', 'CHNR', 'CHRA', 'CHS', 'CHU', 'CIDM', 'CIG', 'CIO', 'CJJD', 'CKPT', 'CLBS', 'CLIR', 'CLNC', 'CLNY', 'CLPS', 'CLRB', 'CLS', 'CLSD', 'CLSN', 'CLVR', 'CLVS', 'CLXT', 'CMCM', 'CMO', 'CMRE', 'CMRX', 'CNDT', 'CNET', 'CNFR', 'CNSL', 'CNSP', 'CNTY', 'COCP', 'COGT', 'COMS', 'CORR', 'CPG', 'CPHI', 'CPRX', 'CPSH', 'CRBP', 'CREG', 'CREX', 'CRIS', 'CRK', 'CRKN', 'CRMD', 'CRNT', 'CSCW', 'CSLT', 'CSPR', 'CTEK', 'CTIB', 'CTIC', 'CTK', 'CTMX', 'CTRM', 'CTSO', 'CTXR', 'CVE', 'CVGI', 'CWBR', 'CX', 'CXW', 'CYCC', 'CYCN', 'CYRN', 'CYTH', 'DARE', 'DBVT', 'DFFN', 'DGLY', 'DHC', 'DHT', 'DLPN', 'DNK', 'DNN', 'DNOW', 'DOGZ', 'DPW', 'DRH', 'DRRX', 'DRTT', 'DS', 'DSKE', 'DSS', 'DSSI', 'DSX', 'DTEA', 'DTSS', 'DUO', 'DVAX', 'DXF', 'DXLG', 'DYNT', 'EARS', 'EBON', 'EBR', 'ECOR', 'EDSA', 'EGY', 'EIGR', 'ELVT', 'ELYS', 'EMAN', 'EMKR', 'EMX', 'ENBL', 'ENDP', 'ENG', 'ENIA', 'ENIC', 'ENLC', 'ENSV', 'ENTX', 'ENVB', 'ENZ', 'EOLS', 'EQ', 'EQX', 'ERF', 'ERJ', 'ESGC', 'ESTE', 'ET', 'ETM', 'ETRN', 'ETTX', 'EURN', 'EVC', 'EVFM', 'EVGN', 'EVK', 'EVOK', 'EXK', 'EXPR', 'EXTR', 'EYEG', 'EYES', 'EZGO', 'EZPW', 'FAMI', 'FBIO', 'FBP', 'FENG', 'FI', 'FINV', 'FLDM', 'FLMN', 'FLNT', 'FLY', 'FORD', 'FPAY', 'FRBK', 'FRO', 'FRSX', 'FSM', 'FSP', 'FTEK', 'FTFT', 'FTK', 'FURY', 'GAU', 'GBS', 'GCI', 'GEL', 'GEN', 'GENE', 'GEO', 'GERN', 'GFI', 'GGAL', 'GGB', 'GHSI', 'GLBS', 'GLDG', 'GLG', 'GLOG', 'GLOP', 'GLUU', 'GLYC', 'GMBL', 'GMDA', 'GMLP', 'GNCA', 'GNK', 'GNLN', 'GNPX', 'GNUS', 'GNW', 'GOGL', 'GOL', 'GORO', 'GOSS', 'GOVX', 'GPL', 'GPMT', 'GPRO', 'GRIL', 'GRNQ', 'GSAT', 'GSKY', 'GSM', 'GSS', 'GSV', 'GTE', 'GTEC', 'GTT', 'GV', 'GVP', 'HAPP', 'HBM', 'HCDI', 'HCHC', 'HDSN', 'HEPA', 'HEXO', 'HGSH', 'HIL', 'HIMX', 'HJLI', 'HL', 'HLIT', 'HLX', 'HMHC', 'HMY', 'HNRG', 'HOFV', 'HOTH', 'HSTO', 'HT', 'HTBX', 'HUGE', 'HUSA', 'HUSN', 'HX', 'HYRE', 'IAG', 'IBIO', 'ICD', 'ICON', 'ID', 'IDEX', 'IDRA', 'IFMK', 'IFRX', 'IGC', 'IHT', 'IKT', 'IMAC', 'IMGN', 'IMMP', 'IMTE', 'IMV', 'INDO', 'INFI', 'ING', 'INN', 'INOD', 'INPX', 'INUV', 'IO', 'IPDN', 'IRIX', 'ISEE', 'ISIG', 'ISR', 'ITP', 'ITRM', 'ITUB', 'IVR', 'IZEA', 'JAGX', 'JE', 'JFIN', 'JFU', 'JG', 'JIH.W', 'JILL', 'JOB', 'JUPW', 'KALA', 'KBNT', 'KBSF', 'KDMN', 'KERN', 'KGC', 'KIN', 'KIQ', 'KMPH', 'KNDI', 'KODK', 'KOPN', 'KOS', 'KRKR', 'KRMD', 'KTRA', 'KUKE', 'KXIN', 'KZIA', 'LCI', 'LCTX', 'LEAF', 'LEE', 'LGHL', 'LIFE', 'LITB', 'LIVX', 'LIZI', 'LJPC', 'LKCO', 'LLIT', 'LLNW', 'LMFA', 'LMNL', 'LODE', 'LOMA', 'LPCN', 'LPTH', 'LPTX', 'LQDA', 'LSEA', 'LTBR', 'LTRPA', 'LX', 'LXRX', 'LYG', 'MACK', 'MARK', 'MBI', 'MBII', 'MBIO', 'MBRX', 'MBT', 'MCEP', 'MCF', 'MDGS', 'MDXG', 'MEIP', 'MESA', 'MESO', 'METX', 'MFA', 'MFG', 'MFGP', 'MFH', 'MGI', 'MGY', 'MHLD', 'MICT', 'MIN', 'MIND', 'MITO', 'MITT', 'MKD', 'MKGI', 'MLND', 'MLSS', 'MNKD', 'MOGO', 'MOGU', 'MOHO', 'MOSY', 'MOTS', 'MOXC', 'MPLN', 'MRC', 'MREO', 'MRIN', 'MRKR', 'MRO', 'MSN', 'MTA', 'MTC', 'MTL', 'MTNB', 'MTP', 'MTSL', 'MUFG', 'MUX', 'MVIS', 'MYSZ', 'MYT', 'NAK', 'NAKD', 'NAOV', 'NAT', 'NAVB', 'NBEV', 'NBRV', 'NBSE', 'NBY', 'NCMI', 'NCNA', 'NDRA', 'NEOS', 'NEPT', 'NERV', 'NES', 'NEW', 'NEX', 'NG', 'NGD', 'NGL', 'NH', 'NLY', 'NMCI', 'NMRK', 'NMTR', 'NNVC', 'NOK', 'NOVN', 'NR', 'NRZ', 'NSCO', 'NSPR', 'NTEC', 'NTN', 'NURO', 'NVCN', 'NVIV', 'NWG', 'NXE', 'NXTD', 'NYMT', 'OBLG', 'OBLN', 'OBSV', 'OCG', 'OCGN', 'OCSL', 'OCX', 'OEG', 'OGEN', 'OGI', 'OIBR.C', 'OII', 'OIIM', 'OIS', 'ONCT', 'ONCY', 'ONTX', 'OPGN', 'OPK', 'OPTN', 'OPTT', 'ORBC', 'ORC', 'ORMP', 'ORN', 'ORTX', 'OSMT', 'OSW', 'OTIC', 'OTLK', 'OVID', 'OXBR', 'OXLC', 'PAA', 'PAE', 'PAGP', 'PAVM', 'PAYS', 'PBF', 'PBI', 'PDSB', 'PED', 'PEI', 'PEIX', 'PFMT', 'PGEN', 'PGRE', 'PHAS', 'PHIO', 'PHUN', 'PIRS', 'PIXY', 'PLAG', 'PLG', 'PLIN', 'PLM', 'PLYA', 'PNNT', 'POAI', 'POWW', 'PPBT', 'PPR', 'PPSI', 'PPT', 'PROG', 'PRPO', 'PRQR', 'PRTK', 'PRTY', 'PSEC', 'PSTI', 'PSTV', 'PT', 'PTE', 'PTEN', 'PTMN', 'PTN', 'PULM', 'PUMP', 'PVL', 'PXLW', 'PXS', 'QD', 'QEP', 'QIWI', 'QLGN', 'QLI', 'QTNT', 'QTT', 'QUAD', 'QUOT', 'RAIL', 'RAVE', 'RBBN', 'RCON', 'RDHL', 'REED', 'REFR', 'REI', 'REPH', 'RES', 'RESN', 'RETO', 'RFP', 'RGLS', 'RGS', 'RHE', 'RIBT', 'RIG', 'RIGL', 'RKDA', 'RLH', 'RMED', 'RMTI', 'RNWK', 'RPAI', 'RPT', 'RRC', 'RRD', 'RTLR', 'RUHN', 'RWLK', 'RWT', 'RYAM', 'SALM', 'SAN', 'SAND', 'SB', 'SBBP', 'SBS', 'SCKT', 'SCOR', 'SCYX', 'SD', 'SDPI', 'SEAC', 'SEEL', 'SELB', 'SENS', 'SESN', 'SFET', 'SFL', 'SFT', 'SGBX', 'SGLB', 'SGOC', 'SHIP', 'SID', 'SIEN', 'SIF', 'SIFY', 'SILV', 'SINO', 'SINT', 'SIOX', 'SIRI', 'SLCA', 'SLDB', 'SLGG', 'SLRX', 'SLS', 'SM', 'SMFG', 'SMSI', 'SMTS', 'SMTX', 'SNCA', 'SNCR', 'SND', 'SNDE', 'SNDL', 'SNES', 'SNGX', 'SNMP', 'SNOA', 'SNR', 'SNSS', 'SOI', 'SOLO', 'SONM', 'SONN', 'SOS', 'SPCB', 'SPPI', 'SQFT', 'SQNS', 'SREV', 'SRGA', 'SSL', 'STAF', 'STCN', 'STON', 'STSA', 'SUP', 'SUPV', 'SVM', 'SVRA', 'SWN', 'SXC', 'SXTC', 'SYBX', 'SYN', 'SYPR', 'TACO', 'TALO', 'TANH', 'TAOP', 'TAST', 'TAT', 'TATT', 'TBLT', 'TCCO', 'TCDA', 'TCON', 'TEDU', 'TEF', 'TELL', 'TENX', 'TEO', 'TGA', 'TGB', 'TGC', 'THM', 'THMO', 'TK', 'TKAT', 'TKC', 'TLGT', 'TLMD', 'TLSA', 'TLYS', 'TMBR', 'TMDI', 'TMQ', 'TMST', 'TNAV', 'TNXP', 'TOPS', 'TOUR', 'TPRE', 'TRCH', 'TRIB', 'TRIT', 'TRST', 'TRUE', 'TRVG', 'TRVN', 'TRX', 'TRXC', 'TTI', 'TTNP', 'TTOO', 'TUSK', 'TV', 'TWI', 'TWO', 'TXMD', 'TYME', 'UAMY', 'UBX', 'UEC', 'UEPS', 'UGP', 'UMC', 'UONE', 'UONEK', 'URG', 'USAS', 'USAT', 'USEG', 'USIO', 'USWS', 'USX', 'UTSI', 'UUUU', 'UWMC', 'UXIN', 'VBIV', 'VBLT', 'VCNX', 'VEDL', 'VEON', 'VERB', 'VERO', 'VERU', 'VET', 'VGZ', 'VHC', 'VIOT', 'VIRI', 'VISL', 'VIV', 'VIVE', 'VKTX', 'VNTR', 'VRA', 'VRAY', 'VSTM', 'VTGN', 'VTNR', 'VTVT', 'VVOS', 'VXRT', 'VYGR', 'VYNE', 'WATT', 'WEI', 'WETF', 'WIMI', 'WISA', 'WIT', 'WKEY', 'WMC', 'WORX', 'WPRT', 'WPX', 'WRAP', 'WRN', 'WSR', 'WTER', 'WTI', 'WTRH', 'WTTR', 'WVE', 'WWR', 'XAIR', 'XAN', 'XBIO', 'XCUR', 'XELA', 'XELB', 'XERS', 'XNET', 'XPL', 'XSPA', 'XXII', 'YCBD', 'YGYI', 'YJ', 'YPF', 'YRCW', 'YTRA', 'YVR', 'ZAGG', 'ZIOP', 'ZIXI', 'ZKIN', 'ZNGA', 'ZOM', 'ZSAN', 'ZVO', 'ZYNE', '']
# validate is optional but will go through your list and keep only valid symbols
t = Ticker(symbols, validate=True)
data = t.quotes
d = {k: v['longName'] for k, v in data.items()}
Ok,
here is one way to obtain what you want in about 2min.
Some tickers are bad, that's why it crashes.
Here's the code. I use joblib for threading or multiprocess since it doesn't work in my env. But, that's the spirit.
%%time
import joblib
from joblib import Parallel,delayed
WRONG_TICKERS = []
database = {}
stocks = ['AAU', 'ABEO', 'ABEV', 'ABIO', 'ABUS', 'ACCO', 'ACER', 'ACIU', 'ACOR', 'ACRX', 'ACST', 'ACTG', 'ADAP', 'ADIL', 'ADMA', 'ADMP', 'ADT', 'ADTX', 'ADXS', 'AEG', 'AEHL', 'AEHR', 'AEMD', 'AESE', 'AEY', 'AEZS', 'AFIN', 'AFMD', 'AGEN', 'AGI', 'AGRO', 'AGRX', 'AGS', 'AGTC', 'AHPI', 'AHT', 'AIHS', 'AIKI', 'AIM', 'AINC', 'AIRI', 'AIV', 'AKBA', 'AKER', 'AKTX', 'ALNA', 'ALRN', 'ALSK', 'AM', 'AMBO', 'AMC', 'AMPE', 'AMPY', 'AMRN', 'AMRS', 'AMRX', 'AMTX', 'ANCN', 'ANH', 'ANIX', 'ANPC', 'ANTE', 'ANY', 'APDN', 'APM', 'APRE', 'APRN', 'APTO', 'APTS', 'APTX', 'APWC', 'AQMS', 'AQST', 'AR', 'ARAY', 'ARC', 'ARCO', 'ARDX', 'AREC', 'ARKO', 'ARLO', 'ARLP', 'AROC', 'ARPO', 'ARTL', 'ASC', 'ASLN', 'ASM', 'ASMB', 'ASRT', 'ASTC', 'ASX', 'ATAX', 'ATHE', 'ATHX', 'ATIF', 'ATNF', 'ATNM', 'ATOS', 'ATRS', 'ATXI', 'AUMN', 'AUTO', 'AUVI', 'AUY', 'AVCO', 'AVDL', 'AVEO', 'AVGR', 'AVXL', 'AWH', 'AWX', 'AXAS', 'AXL', 'AXU', 'AYRO', 'AYTU', 'AZRX', 'BBAR', 'BBD', 'BBGI', 'BBI', 'BBIG', 'BBVA', 'BBW', 'BCDA', 'BCLI', 'BCRX', 'BCS', 'BDR', 'BDSI', 'BEST', 'BGCP', 'BGI', 'BHAT', 'BHR', 'BHTG', 'BIMI', 'BIOC', 'BIOL', 'BKCC', 'BKD', 'BKEP', 'BKYI', 'BLCM', 'BLCT', 'BLIN', 'BLRX', 'BLU', 'BMRA', 'BNED', 'BNTC', 'BORR', 'BOXL', 'BPT', 'BPTH', 'BQ', 'BREZR', 'BRFS', 'BRN', 'BRPAR', 'BRQS', 'BRY', 'BSBR', 'BSGM', 'BSM', 'BSMX', 'BTG', 'BTU', 'BVXV', 'BW', 'BWEN', 'BXRX', 'BYFC', 'CAAP', 'CAAS', 'CALA', 'CAN', 'CANF', 'CAPR', 'CARV', 'CASA', 'CASI', 'CATB', 'CBAT', 'CBAY', 'CBIO', 'CBLI', 'CCO', 'CCRC', 'CCRN', 'CDE', 'CDEV', 'CDTX', 'CDXC', 'CEI', 'CEIX', 'CEMI', 'CERC', 'CERS', 'CETX', 'CFMS', 'CGIX', 'CHEK', 'CHMA', 'CHNR', 'CHRA', 'CHS', 'CHU', 'CIDM', 'CIG', 'CIO', 'CJJD', 'CKPT', 'CLBS', 'CLIR', 'CLNC', 'CLNY', 'CLPS', 'CLRB', 'CLS', 'CLSD', 'CLSN', 'CLVR', 'CLVS', 'CLXT', 'CMCM', 'CMO', 'CMRE', 'CMRX', 'CNDT', 'CNET', 'CNFR', 'CNSL', 'CNSP', 'CNTY', 'COCP', 'COGT', 'COMS', 'CORR', 'CPG', 'CPHI', 'CPRX', 'CPSH', 'CRBP', 'CREG', 'CREX', 'CRIS', 'CRK', 'CRKN', 'CRMD', 'CRNT', 'CSCW', 'CSLT', 'CSPR', 'CTEK', 'CTIB', 'CTIC', 'CTK', 'CTMX', 'CTRM', 'CTSO', 'CTXR', 'CVE', 'CVGI', 'CWBR', 'CX', 'CXW', 'CYCC', 'CYCN', 'CYRN', 'CYTH', 'DARE', 'DBVT', 'DFFN', 'DGLY', 'DHC', 'DHT', 'DLPN', 'DNK', 'DNN', 'DNOW', 'DOGZ', 'DPW', 'DRH', 'DRRX', 'DRTT', 'DS', 'DSKE', 'DSS', 'DSSI', 'DSX', 'DTEA', 'DTSS', 'DUO', 'DVAX', 'DXF', 'DXLG', 'DYNT', 'EARS', 'EBON', 'EBR', 'ECOR', 'EDSA', 'EGY', 'EIGR', 'ELVT', 'ELYS', 'EMAN', 'EMKR', 'EMX', 'ENBL', 'ENDP', 'ENG', 'ENIA', 'ENIC', 'ENLC', 'ENSV', 'ENTX', 'ENVB', 'ENZ', 'EOLS', 'EQ', 'EQX', 'ERF', 'ERJ', 'ESGC', 'ESTE', 'ET', 'ETM', 'ETRN', 'ETTX', 'EURN', 'EVC', 'EVFM', 'EVGN', 'EVK', 'EVOK', 'EXK', 'EXPR', 'EXTR', 'EYEG', 'EYES', 'EZGO', 'EZPW', 'FAMI', 'FBIO', 'FBP', 'FENG', 'FI', 'FINV', 'FLDM', 'FLMN', 'FLNT', 'FLY', 'FORD', 'FPAY', 'FRBK', 'FRO', 'FRSX', 'FSM', 'FSP', 'FTEK', 'FTFT', 'FTK', 'FURY', 'GAU', 'GBS', 'GCI', 'GEL', 'GEN', 'GENE', 'GEO', 'GERN', 'GFI', 'GGAL', 'GGB', 'GHSI', 'GLBS', 'GLDG', 'GLG', 'GLOG', 'GLOP', 'GLUU', 'GLYC', 'GMBL', 'GMDA', 'GMLP', 'GNCA', 'GNK', 'GNLN', 'GNPX', 'GNUS', 'GNW', 'GOGL', 'GOL', 'GORO', 'GOSS', 'GOVX', 'GPL', 'GPMT', 'GPRO', 'GRIL', 'GRNQ', 'GSAT', 'GSKY', 'GSM', 'GSS', 'GSV', 'GTE', 'GTEC', 'GTT', 'GV', 'GVP', 'HAPP', 'HBM', 'HCDI', 'HCHC', 'HDSN', 'HEPA', 'HEXO', 'HGSH', 'HIL', 'HIMX', 'HJLI', 'HL', 'HLIT', 'HLX', 'HMHC', 'HMY', 'HNRG', 'HOFV', 'HOTH', 'HSTO', 'HT', 'HTBX', 'HUGE', 'HUSA', 'HUSN', 'HX', 'HYRE', 'IAG', 'IBIO', 'ICD', 'ICON', 'ID', 'IDEX', 'IDRA', 'IFMK', 'IFRX', 'IGC', 'IHT', 'IKT', 'IMAC', 'IMGN', 'IMMP', 'IMTE', 'IMV', 'INDO', 'INFI', 'ING', 'INN', 'INOD', 'INPX', 'INUV', 'IO', 'IPDN', 'IRIX', 'ISEE', 'ISIG', 'ISR', 'ITP', 'ITRM', 'ITUB', 'IVR', 'IZEA', 'JAGX', 'JE', 'JFIN', 'JFU', 'JG', 'JIH.W', 'JILL', 'JOB', 'JUPW', 'KALA', 'KBNT', 'KBSF', 'KDMN', 'KERN', 'KGC', 'KIN', 'KIQ', 'KMPH', 'KNDI', 'KODK', 'KOPN', 'KOS', 'KRKR', 'KRMD', 'KTRA', 'KUKE', 'KXIN', 'KZIA', 'LCI', 'LCTX', 'LEAF', 'LEE', 'LGHL', 'LIFE', 'LITB', 'LIVX', 'LIZI', 'LJPC', 'LKCO', 'LLIT', 'LLNW', 'LMFA', 'LMNL', 'LODE', 'LOMA', 'LPCN', 'LPTH', 'LPTX', 'LQDA', 'LSEA', 'LTBR', 'LTRPA', 'LX', 'LXRX', 'LYG', 'MACK', 'MARK', 'MBI', 'MBII', 'MBIO', 'MBRX', 'MBT', 'MCEP', 'MCF', 'MDGS', 'MDXG', 'MEIP', 'MESA', 'MESO', 'METX', 'MFA', 'MFG', 'MFGP', 'MFH', 'MGI', 'MGY', 'MHLD', 'MICT', 'MIN', 'MIND', 'MITO', 'MITT', 'MKD', 'MKGI', 'MLND', 'MLSS', 'MNKD', 'MOGO', 'MOGU', 'MOHO', 'MOSY', 'MOTS', 'MOXC', 'MPLN', 'MRC', 'MREO', 'MRIN', 'MRKR', 'MRO', 'MSN', 'MTA', 'MTC', 'MTL', 'MTNB', 'MTP', 'MTSL', 'MUFG', 'MUX', 'MVIS', 'MYSZ', 'MYT', 'NAK', 'NAKD', 'NAOV', 'NAT', 'NAVB', 'NBEV', 'NBRV', 'NBSE', 'NBY', 'NCMI', 'NCNA', 'NDRA', 'NEOS', 'NEPT', 'NERV', 'NES', 'NEW', 'NEX', 'NG', 'NGD', 'NGL', 'NH', 'NLY', 'NMCI', 'NMRK', 'NMTR', 'NNVC', 'NOK', 'NOVN', 'NR', 'NRZ', 'NSCO', 'NSPR', 'NTEC', 'NTN', 'NURO', 'NVCN', 'NVIV', 'NWG', 'NXE', 'NXTD', 'NYMT', 'OBLG', 'OBLN', 'OBSV', 'OCG', 'OCGN', 'OCSL', 'OCX', 'OEG', 'OGEN', 'OGI', 'OIBR.C', 'OII', 'OIIM', 'OIS', 'ONCT', 'ONCY', 'ONTX', 'OPGN', 'OPK', 'OPTN', 'OPTT', 'ORBC', 'ORC', 'ORMP', 'ORN', 'ORTX', 'OSMT', 'OSW', 'OTIC', 'OTLK', 'OVID', 'OXBR', 'OXLC', 'PAA', 'PAE', 'PAGP', 'PAVM', 'PAYS', 'PBF', 'PBI', 'PDSB', 'PED', 'PEI', 'PEIX', 'PFMT', 'PGEN', 'PGRE', 'PHAS', 'PHIO', 'PHUN', 'PIRS', 'PIXY', 'PLAG', 'PLG', 'PLIN', 'PLM', 'PLYA', 'PNNT', 'POAI', 'POWW', 'PPBT', 'PPR', 'PPSI', 'PPT', 'PROG', 'PRPO', 'PRQR', 'PRTK', 'PRTY', 'PSEC', 'PSTI', 'PSTV', 'PT', 'PTE', 'PTEN', 'PTMN', 'PTN', 'PULM', 'PUMP', 'PVL', 'PXLW', 'PXS', 'QD', 'QEP', 'QIWI', 'QLGN', 'QLI', 'QTNT', 'QTT', 'QUAD', 'QUOT', 'RAIL', 'RAVE', 'RBBN', 'RCON', 'RDHL', 'REED', 'REFR', 'REI', 'REPH', 'RES', 'RESN', 'RETO', 'RFP', 'RGLS', 'RGS', 'RHE', 'RIBT', 'RIG', 'RIGL', 'RKDA', 'RLH', 'RMED', 'RMTI', 'RNWK', 'RPAI', 'RPT', 'RRC', 'RRD', 'RTLR', 'RUHN', 'RWLK', 'RWT', 'RYAM', 'SALM', 'SAN', 'SAND', 'SB', 'SBBP', 'SBS', 'SCKT', 'SCOR', 'SCYX', 'SD', 'SDPI', 'SEAC', 'SEEL', 'SELB', 'SENS', 'SESN', 'SFET', 'SFL', 'SFT', 'SGBX', 'SGLB', 'SGOC', 'SHIP', 'SID', 'SIEN', 'SIF', 'SIFY', 'SILV', 'SINO', 'SINT', 'SIOX', 'SIRI', 'SLCA', 'SLDB', 'SLGG', 'SLRX', 'SLS', 'SM', 'SMFG', 'SMSI', 'SMTS', 'SMTX', 'SNCA', 'SNCR', 'SND', 'SNDE', 'SNDL', 'SNES', 'SNGX', 'SNMP', 'SNOA', 'SNR', 'SNSS', 'SOI', 'SOLO', 'SONM', 'SONN', 'SOS', 'SPCB', 'SPPI', 'SQFT', 'SQNS', 'SREV', 'SRGA', 'SSL', 'STAF', 'STCN', 'STON', 'STSA', 'SUP', 'SUPV', 'SVM', 'SVRA', 'SWN', 'SXC', 'SXTC', 'SYBX', 'SYN', 'SYPR', 'TACO', 'TALO', 'TANH', 'TAOP', 'TAST', 'TAT', 'TATT', 'TBLT', 'TCCO', 'TCDA', 'TCON', 'TEDU', 'TEF', 'TELL', 'TENX', 'TEO', 'TGA', 'TGB', 'TGC', 'THM', 'THMO', 'TK', 'TKAT', 'TKC', 'TLGT', 'TLMD', 'TLSA', 'TLYS', 'TMBR', 'TMDI', 'TMQ', 'TMST', 'TNAV', 'TNXP', 'TOPS', 'TOUR', 'TPRE', 'TRCH', 'TRIB', 'TRIT', 'TRST', 'TRUE', 'TRVG', 'TRVN', 'TRX', 'TRXC', 'TTI', 'TTNP', 'TTOO', 'TUSK', 'TV', 'TWI', 'TWO', 'TXMD', 'TYME', 'UAMY', 'UBX', 'UEC', 'UEPS', 'UGP', 'UMC', 'UONE', 'UONEK', 'URG', 'USAS', 'USAT', 'USEG', 'USIO', 'USWS', 'USX', 'UTSI', 'UUUU', 'UWMC', 'UXIN', 'VBIV', 'VBLT', 'VCNX', 'VEDL', 'VEON', 'VERB', 'VERO', 'VERU', 'VET', 'VGZ', 'VHC', 'VIOT', 'VIRI', 'VISL', 'VIV', 'VIVE', 'VKTX', 'VNTR', 'VRA', 'VRAY', 'VSTM', 'VTGN', 'VTNR', 'VTVT', 'VVOS', 'VXRT', 'VYGR', 'VYNE', 'WATT', 'WEI', 'WETF', 'WIMI', 'WISA', 'WIT', 'WKEY', 'WMC', 'WORX', 'WPRT', 'WPX', 'WRAP', 'WRN', 'WSR', 'WTER', 'WTI', 'WTRH', 'WTTR', 'WVE', 'WWR', 'XAIR', 'XAN', 'XBIO', 'XCUR', 'XELA', 'XELB', 'XERS', 'XNET', 'XPL', 'XSPA', 'XXII', 'YCBD', 'YGYI', 'YJ', 'YPF', 'YRCW', 'YTRA', 'YVR', 'ZAGG', 'ZIOP', 'ZIXI', 'ZKIN', 'ZNGA', 'ZOM', 'ZSAN', 'ZVO', 'ZYNE']
def get_name(_ticker):
try:
database[_ticker] = yf.Ticker(_ticker).info['longName']
except:
WRONG_TICKERS.append(_ticker)
pass
return(database)
number_of_cpu = joblib.cpu_count()
delayed_funcs = [delayed(get_name)(_ticker) for _ticker in stocks]
parallel_pool = Parallel(n_jobs=number_of_cpu,prefer="threads") # processes threads
parallel_pool(delayed_funcs)
OUTPUT:
Note that depending on your computer, it could be faster withe 'processes' instead of 'threads'. You have to test to know it.
Edit : When re-running the same code, everything is in 404 ERROR. Bust be a problem with yfinance
Edit 2 : It's okay again...
I have a python code need to draw a networkx graph, it can output normally. However, I got some problems in the following code.
import networkx as nx
import matplotlib.pyplot as plt
import matplotlib as mpl
from networkx.drawing.nx_agraph import write_dot
import csv
import time
tStart = time.time()#計時開始
plt.rcParams['font.sans-serif']=['SimHei']
plt.rcParams['font.serif'] = ['KaiTi']
plt.rcParams['axes.unicode_minus'] = False
G = nx.DiGraph()
G.add_edge("A","B") # add a new edge
G.add_edge("B","C") # add a new edge
G.add_edge("D","D")
fig = plt.figure(figsize=(30,30))
ax = plt.subplot(111)
ax.set_title('Graph - ShapesS', fontsize=18)
pos = nx.spring_layout(G,k=0.5,iterations=10)
node_sizes = 5
edge_color = 'green'
nx.draw_networkx(G, pos, node_color = 'yellow')
edges = nx.draw_networkx_edges(
G,
pos,
node_size=node_sizes,
arrowstyle="->",
arrowsize=10,
edge_color=edge_color,
edge_cmap=plt.cm.Blues,
width=2,
)
plt.rcParams['font.sans-serif']=['SimHei'] #显示中文标签
plt.rcParams['font.serif'] = ['KaiTi']
plt.rcParams['axes.unicode_minus'] = False
ax = plt.gca()
ax.set_axis_off()
plt.show(block=False)
plt.savefig("NetworkxTest.png", format="PNG", encoding = 'utf-8', width = 10)
tEnd = time.time()#計時結束
#列印結果
print("執行時間 %f 秒" % (tEnd - tStart))#會自動做近位
I want to make a graph to show the best result, but I cannot make it better. The reason is it cannot show their self-loop.
I want to make the following result
However, I tried a lot of methods and it is not working or I got some error.
For example, when I tried to use the following method, it will get some error.
Method: nx.write_dot(G,'graph.dot')
Error: AttributeError: module 'networkx' has no attribute 'write_dot'
I want to know that can I use networkx to make this result? Or, I want to know which tools can better to make in python or R language? (Don't tell me igraph in R)
When I enter print([i for i in dir(nx) if not i.startswith('_')]) code, I get the following information:
['AmbiguousSolution', 'DiGraph', 'ExceededMaxIterations', 'Graph', 'GraphMLReader', 'GraphMLWriter', 'HasACycle', 'LCF_graph', 'MultiDiGraph', 'MultiGraph', 'NetworkXAlgorithmError', 'NetworkXError', 'NetworkXException', 'NetworkXNoCycle', 'NetworkXNoPath', 'NetworkXNotImplemented', 'NetworkXPointlessConcept', 'NetworkXTreewidthBoundExceeded', 'NetworkXUnbounded', 'NetworkXUnfeasible', 'NodeNotFound', 'NotATree', 'OrderedDiGraph', 'OrderedGraph', 'OrderedMultiDiGraph', 'OrderedMultiGraph', 'PlanarEmbedding', 'PowerIterationFailedConvergence', 'absolute_import', 'adamic_adar_index', 'add_cycle', 'add_path', 'add_star', 'adj_matrix', 'adjacency', 'adjacency_data', 'adjacency_graph', 'adjacency_matrix', 'adjacency_spectrum', 'adjlist', 'algebraic_connectivity', 'algebraicconnectivity', 'algorithms', 'all', 'all_neighbors', 'all_node_cuts', 'all_pairs_bellman_ford_path', 'all_pairs_bellman_ford_path_length', 'all_pairs_dijkstra', 'all_pairs_dijkstra_path', 'all_pairs_dijkstra_path_length', 'all_pairs_lowest_common_ancestor', 'all_pairs_node_connectivity', 'all_pairs_shortest_path', 'all_pairs_shortest_path_length', 'all_shortest_paths', 'all_simple_paths', 'all_topological_sorts', 'ancestors', 'antichains', 'approximate_current_flow_betweenness_centrality', 'articulation_points', 'assortativity', 'astar', 'astar_path', 'astar_path_length', 'atlas', 'attr_matrix', 'attr_sparse_matrix', 'attracting', 'attracting_component_subgraphs', 'attracting_components', 'attribute_assortativity_coefficient', 'attribute_mixing_dict', 'attribute_mixing_matrix', 'attrmatrix', 'authority_matrix', 'average_clustering', 'average_degree_connectivity', 'average_neighbor_degree', 'average_node_connectivity', 'average_shortest_path_length', 'balanced_tree', 'barabasi_albert_graph', 'barbell_graph', 'beamsearch', 'bellman_ford_path', 'bellman_ford_path_length', 'bellman_ford_predecessor_and_distance', 'betweenness', 'betweenness_centrality', 'betweenness_centrality_source', 'betweenness_centrality_subset', 'betweenness_subset', 'bfs_beam_edges', 'bfs_edges', 'bfs_predecessors', 'bfs_successors', 'bfs_tree', 'biconnected', 'biconnected_component_edges', 'biconnected_component_subgraphs', 'biconnected_components', 'bidirectional_dijkstra', 'bidirectional_shortest_path', 'binary', 'binomial_graph', 'bipartite', 'bipartite_layout', 'boundary', 'boundary_expansion', 'breadth_first_search', 'bridges', 'bull_graph', 'capacity_scaling', 'cartesian_product', 'caveman_graph', 'center', 'centrality', 'chain_decomposition', 'chains', 'check_planarity', 'chordal', 'chordal_cycle_graph', 'chordal_graph_cliques', 'chordal_graph_treewidth', 'chvatal_graph', 'circulant_graph', 'circular_ladder_graph', 'circular_layout', 'classes', 'classic', 'clique', 'cliques_containing_node', 'closeness', 'closeness_centrality', 'closeness_vitality', 'cluster', 'clustering', 'cn_soundarajan_hopcroft', 'coloring', 'combinatorial_embedding_to_pos', 'common_neighbors', 'communicability', 'communicability_alg', 'communicability_betweenness_centrality', 'communicability_exp', 'community', 'complement', 'complete_bipartite_graph', 'complete_graph', 'complete_multipartite_graph', 'components', 'compose', 'compose_all', 'condensation', 'conductance', 'configuration_model', 'connected', 'connected_caveman_graph', 'connected_component_subgraphs', 'connected_components', 'connected_double_edge_swap', 'connected_watts_strogatz_graph', 'connectivity', 'constraint', 'contracted_edge', 'contracted_nodes', 'convert', 'convert_matrix', 'convert_node_labels_to_integers', 'core', 'core_number', 'coreviews', 'correlation', 'cost_of_flow', 'could_be_isomorphic', 'covering', 'create_empty_copy', 'cubical_graph', 'current_flow_betweenness', 'current_flow_betweenness_centrality', 'current_flow_betweenness_centrality_subset', 'current_flow_betweenness_subset', 'current_flow_closeness', 'current_flow_closeness_centrality', 'cut_size', 'cuts', 'cycle_basis', 'cycle_graph', 'cycles', 'cytoscape', 'cytoscape_data', 'cytoscape_graph', 'dag', 'dag_longest_path', 'dag_longest_path_length', 'dag_to_branching', 'davis_southern_women_graph', 'degree', 'degree_alg', 'degree_assortativity_coefficient', 'degree_centrality', 'degree_histogram', 'degree_mixing_dict', 'degree_mixing_matrix', 'degree_pearson_correlation_coefficient', 'degree_seq', 'degree_sequence_tree', 'dense', 'dense_gnm_random_graph', 'density', 'depth_first_search', 'desargues_graph', 'descendants', 'dfs_edges', 'dfs_labeled_edges', 'dfs_postorder_nodes', 'dfs_predecessors', 'dfs_preorder_nodes', 'dfs_successors', 'dfs_tree', 'diameter', 'diamond_graph', 'difference', 'digraph', 'dijkstra_path', 'dijkstra_path_length', 'dijkstra_predecessor_and_distance', 'directed', 'directed_combinatorial_laplacian_matrix', 'directed_configuration_model', 'directed_havel_hakimi_graph', 'directed_laplacian_matrix', 'directed_modularity_matrix', 'disjoint_union', 'disjoint_union_all', 'dispersion', 'distance_measures', 'distance_regular', 'dodecahedral_graph', 'dominance', 'dominance_frontiers', 'dominating', 'dominating_set', 'dorogovtsev_goltsev_mendes_graph', 'double_edge_swap', 'draw', 'draw_circular', 'draw_kamada_kawai', 'draw_networkx', 'draw_networkx_edge_labels', 'draw_networkx_edges', 'draw_networkx_labels', 'draw_networkx_nodes', 'draw_planar', 'draw_random', 'draw_shell', 'draw_spectral', 'draw_spring', 'drawing', 'dual_barabasi_albert_graph', 'duplication', 'duplication_divergence_graph', 'eccentricity', 'edge_betweenness', 'edge_betweenness_centrality', 'edge_betweenness_centrality_subset', 'edge_bfs', 'edge_boundary', 'edge_connectivity', 'edge_current_flow_betweenness_centrality', 'edge_current_flow_betweenness_centrality_subset', 'edge_dfs', 'edge_disjoint_paths', 'edge_expansion', 'edge_load_centrality', 'edge_subgraph', 'edgebfs', 'edgedfs', 'edgelist', 'edges', 'effective_size', 'efficiency', 'ego', 'ego_graph', 'eigenvector', 'eigenvector_centrality', 'eigenvector_centrality_numpy', 'empty_graph', 'enumerate_all_cliques', 'equitable_color', 'erdos_renyi_graph', 'estrada_index', 'euler', 'eulerian_circuit', 'eulerize', 'exception', 'expanders', 'expected_degree_graph', 'extended_barabasi_albert_graph', 'extrema_bounding', 'fast_could_be_isomorphic', 'fast_gnp_random_graph', 'faster_could_be_isomorphic', 'fiedler_vector', 'filters', 'find_cliques', 'find_cliques_recursive', 'find_cores', 'find_cycle', 'find_induced_nodes', 'florentine_families_graph', 'flow', 'flow_hierarchy', 'flow_matrix', 'floyd_warshall', 'floyd_warshall_numpy', 'floyd_warshall_predecessor_and_distance', 'freeze', 'from_dict_of_dicts', 'from_dict_of_lists', 'from_edgelist', 'from_graph6_bytes', 'from_nested_tuple', 'from_numpy_array', 'from_numpy_matrix', 'from_pandas_adjacency', 'from_pandas_edgelist', 'from_prufer_sequence', 'from_scipy_sparse_matrix', 'from_sparse6_bytes', 'frucht_graph', 'fruchterman_reingold_layout', 'full_rary_tree', 'function', 'gaussian_random_partition_graph', 'general_random_intersection_graph', 'generalized_degree', 'generate_adjlist', 'generate_edgelist', 'generate_gexf', 'generate_gml', 'generate_graphml', 'generate_multiline_adjlist', 'generate_pajek', 'generators', 'generic', 'geographical_threshold_graph', 'geometric', 'get_edge_attributes', 'get_node_attributes', 'gexf', 'global_efficiency', 'global_parameters', 'global_reaching_centrality', 'gml', 'gn_graph', 'gnc_graph', 'gnm_random_graph', 'gnp_random_graph', 'gnr_graph', 'goldberg_radzik', 'gomory_hu_tree', 'google_matrix', 'gpickle', 'graph', 'graph6', 'graph_atlas', 'graph_atlas_g', 'graph_clique_number', 'graph_edit_distance', 'graph_number_of_cliques', 'graphical', 'graphmatrix', 'graphml', 'graphviews', 'greedy_color', 'grid_2d_graph', 'grid_graph', 'harmonic', 'harmonic_centrality', 'has_bridges', 'has_path', 'havel_hakimi_graph', 'heawood_graph', 'hexagonal_lattice_graph', 'hierarchy', 'hits', 'hits_alg', 'hits_numpy', 'hits_scipy', 'hoffman_singleton_graph', 'house_graph', 'house_x_graph', 'hub_matrix', 'hybrid', 'hypercube_graph', 'icosahedral_graph', 'identified_nodes', 'immediate_dominators', 'in_degree_centrality', 'incidence_matrix', 'induced_subgraph', 'info', 'information_centrality', 'intersection', 'intersection_all', 'intersection_array', 'inverse_line_graph', 'is_aperiodic', 'is_arborescence', 'is_attracting_component', 'is_biconnected', 'is_bipartite', 'is_branching', 'is_chordal', 'is_connected', 'is_digraphical', 'is_directed', 'is_directed_acyclic_graph', 'is_distance_regular', 'is_dominating_set', 'is_edge_cover', 'is_empty', 'is_eulerian', 'is_forest', 'is_frozen', 'is_graphical', 'is_isolate', 'is_isomorphic', 'is_k_edge_connected', 'is_kl_connected', 'is_matching', 'is_maximal_matching', 'is_multigraphical', 'is_negatively_weighted', 'is_perfect_matching', 'is_pseudographical', 'is_semiconnected', 'is_simple_path', 'is_strongly_connected', 'is_strongly_regular', 'is_tree', 'is_valid_degree_sequence_erdos_gallai', 'is_valid_degree_sequence_havel_hakimi', 'is_valid_joint_degree', 'is_weakly_connected', 'is_weighted', 'isolate', 'isolates', 'isomorphism', 'jaccard_coefficient', 'jit', 'jit_data', 'jit_graph', 'johnson', 'join', 'joint_degree_graph', 'joint_degree_seq', 'json_graph', 'k_components', 'k_core', 'k_corona', 'k_crust', 'k_edge_augmentation', 'k_edge_components', 'k_edge_subgraphs', 'k_nearest_neighbors', 'k_random_intersection_graph', 'k_shell', 'kamada_kawai_layout', 'karate_club_graph', 'katz', 'katz_centrality', 'katz_centrality_numpy', 'kl_connected_subgraph', 'kosaraju_strongly_connected_components', 'krackhardt_kite_graph', 'ladder_graph', 'laplacian_matrix', 'laplacian_spectrum', 'laplacianmatrix', 'lattice', 'lattice_reference', 'layout', 'leda', 'les_miserables_graph', 'lexicographic_product', 'lexicographical_topological_sort', 'linalg', 'line', 'line_graph', 'link_analysis', 'link_prediction', 'load', 'load_centrality', 'local_bridges', 'local_constraint', 'local_efficiency', 'local_reaching_centrality', 'lollipop_graph', 'lowest_common_ancestor', 'lowest_common_ancestors', 'make_clique_bipartite', 'make_max_clique_graph', 'make_small_graph', 'margulis_gabber_galil_graph', 'matching', 'max_flow_min_cost', 'max_weight_matching', 'maximal_independent_set', 'maximal_matching', 'maximum_branching', 'maximum_flow', 'maximum_flow_value', 'maximum_spanning_arborescence', 'maximum_spanning_edges', 'maximum_spanning_tree', 'min_cost_flow', 'min_cost_flow_cost', 'min_edge_cover', 'minimum_branching', 'minimum_cut', 'minimum_cut_value', 'minimum_cycle_basis', 'minimum_edge_cut', 'minimum_node_cut', 'minimum_spanning_arborescence', 'minimum_spanning_edges', 'minimum_spanning_tree', 'minors', 'mis', 'mixing', 'mixing_dict', 'mixing_expansion', 'modularity_matrix', 'modularity_spectrum', 'modularitymatrix', 'moebius_kantor_graph', 'multi_source_dijkstra', 'multi_source_dijkstra_path', 'multi_source_dijkstra_path_length', 'multidigraph', 'multigraph', 'multiline_adjlist', 'mycielski', 'mycielski_graph', 'mycielskian', 'navigable_small_world_graph', 'negative_edge_cycle', 'neighbor_degree', 'neighbors', 'network_simplex', 'networkx', 'newman_watts_strogatz_graph', 'node_attribute_xy', 'node_boundary', 'node_classification', 'node_clique_number', 'node_connected_component', 'node_connectivity', 'node_degree_xy', 'node_disjoint_paths', 'node_expansion', 'node_link', 'node_link_data', 'node_link_graph', 'nodes', 'nodes_with_selfloops', 'non_edges', 'non_neighbors', 'nonisomorphic_trees', 'normalized_cut_size', 'normalized_laplacian_matrix', 'normalized_laplacian_spectrum', 'not_implemented_for', 'null_graph', 'number_attracting_components', 'number_connected_components', 'number_of_cliques', 'number_of_edges', 'number_of_isolates', 'number_of_nodes', 'number_of_nonisomorphic_trees', 'number_of_selfloops', 'number_strongly_connected_components', 'number_weakly_connected_components', 'numeric_assortativity_coefficient', 'numeric_mixing_matrix', 'nx', 'nx_agraph', 'nx_pydot', 'nx_pylab', 'nx_shp', 'nx_yaml', 'octahedral_graph', 'omega', 'operators', 'optimal_edit_paths', 'optimize_edit_paths', 'optimize_graph_edit_distance', 'ordered', 'out_degree_centrality', 'overall_reciprocity', 'pagerank', 'pagerank_alg', 'pagerank_numpy', 'pagerank_scipy', 'pairs', 'pajek', 'pappus_graph', 'parse_adjlist', 'parse_edgelist', 'parse_gml', 'parse_graphml', 'parse_leda', 'parse_multiline_adjlist', 'parse_pajek', 'partial_duplication_graph', 'path_graph', 'percolation', 'percolation_centrality', 'periphery', 'petersen_graph', 'planar_drawing', 'planar_layout', 'planarity', 'planted_partition_graph', 'power', 'powerlaw_cluster_graph', 'predecessor', 'preferential_attachment', 'prefix_tree', 'product', 'project', 'projected_graph', 'quotient_graph', 'ra_index_soundarajan_hopcroft', 'radius', 'random_clustered', 'random_clustered_graph', 'random_degree_sequence_graph', 'random_geometric_graph', 'random_graphs', 'random_k_out_graph', 'random_kernel_graph', 'random_layout', 'random_lobster', 'random_partition_graph', 'random_powerlaw_tree', 'random_powerlaw_tree_sequence', 'random_reference', 'random_regular_graph', 'random_shell_graph', 'random_tree', 'reaching', 'read_adjlist', 'read_edgelist', 'read_gexf', 'read_gml', 'read_gpickle', 'read_graph6', 'read_graphml', 'read_leda', 'read_multiline_adjlist', 'read_pajek', 'read_shp', 'read_sparse6', 'read_weighted_edgelist', 'read_yaml', 'readwrite', 'reciprocity', 'reconstruct_path', 'recursive_simple_cycles', 'relabel', 'relabel_gexf_graph', 'relabel_nodes', 'relaxed_caveman_graph', 'release', 'reportviews', 'rescale_layout', 'resource_allocation_index', 'restricted_view', 'reverse', 'reverse_view', 'rich_club_coefficient', 'richclub', 'ring_of_cliques', 'rooted_product', 's_metric', 'scale_free_graph', 'second_order', 'second_order_centrality', 'sedgewick_maze_graph', 'selfloop_edges', 'semiconnected', 'set_edge_attributes', 'set_node_attributes', 'shell_layout', 'shortest_path', 'shortest_path_length', 'shortest_paths', 'shortest_simple_paths', 'sigma', 'similarity', 'simple_cycles', 'simple_paths', 'single_source_bellman_ford', 'single_source_bellman_ford_path', 'single_source_bellman_ford_path_length', 'single_source_dijkstra', 'single_source_dijkstra_path', 'single_source_dijkstra_path_length', 'single_source_shortest_path', 'single_source_shortest_path_length', 'single_target_shortest_path', 'single_target_shortest_path_length', 'small', 'smallworld', 'smetric', 'social', 'soft_random_geometric_graph', 'spanner', 'sparse6', 'sparsifiers', 'spectral_graph_forge', 'spectral_layout', 'spectral_ordering', 'spectrum', 'spring_layout', 'square_clustering', 'star_graph', 'stochastic', 'stochastic_block_model', 'stochastic_graph', 'stoer_wars', 'network_simplex', 'networkx', 'newman_watts_strogatz_graph', 'node_attribute_xy', 'node_boundary', 'node_classification', 'node_clique_number', 'node_connected_component', 'node_connectivity', 'node_degree_xy', 'node_disjoint_paths', 'node_expansion', 'node_link', 'node_link_data', 'node_link_graph', 'nodes', 'nodes_with_selfloops', 'non_edges', 'non_neighbors', 'nonisomorphic_trees', 'normalized_cut_size', 'normalized_laplacian_matrix', 'normalized_laplacian_spectrum', 'not_implemented_for', 'null_graph', 'number_attracting_components', 'number_connected_components', 'number_of_cliques', 'number_of_edges', 'number_of_isolates', 'number_of_nodes', 'number_of_nonisomorphic_trees', 'number_of_selfloops', 'number_strongly_connected_components', 'number_weakly_connected_components', 'numeric_assortativity_coefficient', 'numeric_mixing_matrix', 'nx', 'nx_agraph', 'nx_pydot', 'nx_pylab', 'nx_shp', 'nx_yaml', 'octahedral_graph', 'omega', 'operators', 'optimal_edit_paths', 'optimize_edit_paths', 'optimize_graph_edit_distance', 'ordered', 'out_degree_centrality', 'overall_reciprocity', 'pagerank', 'pagerank_alg', 'pagerank_numpy', 'pagerank_scipy', 'pairs', 'pajek', 'pappus_graph', 'parse_adjlist', 'parse_edgelist', 'parse_gml', 'parse_graphml', 'parse_leda', 'parse_multiline_adjlist', 'parse_pajek', 'partial_duplication_graph', 'path_graph', 'percolation', 'percolation_centrality', 'periphery', 'petersen_graph', 'planar_drawing', 'planar_layout', 'planarity', 'planted_partition_graph', 'power', 'powerlaw_cluster_graph', 'predecessor', 'preferential_attachment', 'prefix_tree', 'product', 'project', 'projected_graph', 'quotient_graph', 'ra_index_soundarajan_hopcroft', 'radius', 'random_clustered', 'random_clustered_graph', 'random_degree_sequence_graph', 'random_geometric_graph', 'random_graphs', 'random_k_out_graph', 'random_kernel_graph', 'random_layout', 'random_lobster', 'random_partition_graph', 'random_powerlaw_tree', 'random_powerlaw_tree_sequence', 'random_reference', 'random_regular_graph', 'random_shell_graph', 'random_tree', 'reaching', 'read_adjlist', 'read_edgelist', 'read_gexf', 'read_gml', 'read_gpickle', 'read_graph6', 'read_graphml', 'read_leda', 'read_multiline_adjlist', 'read_pajek', 'read_shp', 'read_sparse6', 'read_weighted_edgelist', 'read_yaml', 'readwrite', 'reciprocity', 'reconstruct_path', 'recursive_simple_cycles', 'relabel', 'relabel_gexf_graph', 'relabel_nodes', 'relaxed_caveman_graph', 'release', 'reportviews', 'rescale_layout', 'resource_allocation_index', 'restricted_view', 'reverse', 'reverse_view', 'rich_club_coefficient', 'richclub', 'ring_of_cliques', 'rooted_product', 's_metric', 'scale_free_graph', 'second_order', 'second_order_centrality', 'sedgewick_maze_graph', 'selfloop_edges', 'semiconnected', 'set_edge_attributes', 'set_node_attributes', 'shell_layout', 'shortest_path', 'shortest_path_length', 'shortest_paths', 'shortest_simple_paths', 'sigma', 'similarity', 'simple_cycles', 'simple_paths', 'single_source_bellman_ford', 'single_source_bellman_ford_path', 'single_source_bellman_ford_path_length', 'single_source_dijkstra', 'single_source_dijkstra_path', 'single_source_dijkstra_path_length', 'single_source_shortest_path', 'single_source_shortest_path_length', 'single_target_shortest_path', 'single_target_shortest_path_length', 'small', 'smallworld', 'smetric', 'social', 'soft_random_geometric_graph', 'spanner', 'sparse6', 'sparsifiers', 'spectral_graph_forge', 'spectral_layout', 'spectral_ordering', 'spectrum', 'spring_layout', 'square_clustering', 'star_graph', 'stochastic', 'stochastic_block_model', 'stochastic_graph', 'stoer_wagner', 'strong_product', 'strongly_connected', 'strongly_connected_component_subgraphs', 'strongly_connected_components', 'strongly_connected_components_recursive', 'structuralholes', 'subgraph', 'subgraph_alg', 'subgraph_centrality', 'subgraph_centrality_exp', 'swap', 'symmetric_difference', 'tensor_product', 'test', 'tests', 'tetrahedral_graph', 'thresholded_random_geometric_graph', 'to_dict_of_dicts', 'to_dict_of_lists', 'to_directed', 'to_edgelist', 'to_graph6_bytes', 'to_nested_tuple', 'to_networkx_graph', 'to_numpy_array', 'to_numpy_matrix', 'to_numpy_recarray', 'to_pandas_adjacency', 'to_pandas_edgelist', 'to_prufer_sequence', 'to_scipy_sparse_matrix', 'to_sparse6_bytes', 'to_undirected', 'topological_sort', 'tournament', 'transitive_closure', 'transitive_reduction', 'transitivity', 'traversal', 'tree', 'tree_all_pairs_lowest_common_ancestor', 'tree_data', 'tree_graph', 'trees', 'triad_graph', 'triadic_census', 'triads', 'triangles', 'triangular_lattice_graph', 'trivial_graph', 'truncated_cube_graph', 'truncated_tetrahedron_graph', 'turan_graph', 'tutte_graph', 'unary', 'uniform_random_intersection_graph', 'union', 'union_all', 'unweighted', 'utils', 'vitality', 'volume', 'voronoi', 'voronoi_cells', 'voterank', 'voterank_alg', 'watts_strogatz_graph', 'waxman_graph', 'weakly_connected', 'weakly_connected_component_subgraphs', 'weakly_connected_components', 'weighted', 'wheel_graph', 'wiener', 'wiener_index', 'windmill_graph', 'within_inter_cluster', 'write_adjlist', 'write_edgelist', 'write_gexf', 'write_gml', 'write_gpickle', 'write_graph6', 'write_graphml', 'write_graphml_lxml', 'write_graphml_xml', 'write_multiline_adjlist', 'write_pajek', 'write_shp', 'write_sparse6', 'write_weighted_edgelist', 'write_yaml']
Can anyone help me? Thanks.