tjbtjbtjb / cocoa Goto Github PK
View Code? Open in Web Editor NEWCoCoA python package
Home Page: https://github.com/tjbtjbtjb/CoCoA#readme
License: MIT License
CoCoA python package
Home Page: https://github.com/tjbtjbtjb/CoCoA#readme
License: MIT License
on ne fait pas de distinguo entre France et DOMTOM. Du coup tout est centré sur la France metropolitaine ...
g.to_standard(['spain','FRA'],output='dict')
gives {} as output.
Moreover, with g.to_standard('European Union',output='dict',interpret_region=True)
, the output dict keys are first letters of input.
iaits…
Should think about requests-cache. But need to configure properly to deal with fast changing data or not…
For example CrystalFig should be crystal_fig or DefFigInteractive should be def_fig_interactive
For example, 'world' is not recognized. Whereas 'World' is.
For countries, nevertheless, it works. This should be fixed for homogenization.
Front-end cocoa.py
'get' function gives a pandas with location column; should be 'where'
There's a lack of docstring in covid19, especially explaining the kwargs in those function.
As an example csv_to_pandas_index_location_date(), pandas_index_location_date_to_jhu_format().
Or even get_stats() where no docstring at all is given.
For the same argument, it's called :
covid19.py
and 'where' in cocoa.py
covid19.py
and 'what' in cocoa.py
from cocoa import world as cw
ImportError Traceback (most recent call last)
in
----> 1 from cocoa import world as cw
ImportError: cannot import name 'world' from 'cocoa' (../cocoa/init.py)
This is a Brexit stuff ?? :-)
/Users/dadoun/Programs/Python/CoCoA/cocoa/geo.py:171: UserWarning: Caution. More than one country match the key "UK" : ['Ukraine, ', 'Latvia, ', 'Uganda, ', 'Albania, ', 'Japan, ', 'Thailand, ', 'Tuvalu, ', 'Indonesia, ', 'Canada, ', 'Croatia, ', 'Philippines, ', 'Slovenia, ', 'Tanzania, United Republic of, ', 'Algeria, ', "Korea, Democratic People's Republic of, ", 'Korea, Republic of, ', 'Russian Federation, ', 'Bhutan, ', 'Micronesia, Federated States of, ', 'Iraq, ', 'Marshall Islands, ', 'Saudi Arabia, ', 'Dominica, ', 'Egypt, ', 'Cambodia, ', 'Morocco, ', 'Turkey, '], using first one.
', using first one.\n')
using the front end cc.plot reload all the time the database and this is not needed (wasting time). This due to the fact that we don't to use constructor ...
Here JHU countries where there are no geometries
Are you aware of that ?
location geometry
3 Andorra None
7 Antigua and Barbuda None
17 Bahrain None
24 Barbados None
38 Comoros None
39 Cabo Verde None
46 Dominica None
69 Grenada None
91 Saint Kitts and Nevis None
98 Saint Lucia None
99 Liechtenstein None
106 Monaco None
109 Maldives None
111 Marshall Islands None
120 Mauritius None
148 Singapore None
152 San Marino None
156 Sao Tome and Principe None
162 Seychelles None
178 Holy See (Vatican City State) None
179 Saint Vincent and the Grenadines None
and we need to start this next release ...
Provide better default plots from the frontend. And push them to the README.
Consider the piece of code :
import cocoa.covid19 as co
jhu = co.DataBase('jhu')
pd=jhu.get_stats(which='confirmed',type='Cumul',location='FRA',output='pandas')
pd.head()
We got the error output below. What's the trouble with the syntax ?
JHU aka Johns Hopkins database selected ...
Available keys words are : ['deaths', 'confirmed', 'recovered']
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-2-cef69dad9529> in <module>
1 jhu = co.DataBase('jhu')
----> 2 pd=jhu.get_stats(which='confirmed',type='Cumul',location='FRA',output='pandas')
3 pd.head()
~/Dropbox/Git/CoCoA/cocoa/covid19.py in get_stats(self, **kwargs)
305 i+=1
306 if output == "pandas":
--> 307 babypandas = pd.DataFrame(data[0])
308 for i in range(1,len(clist)):
309 df=pd.DataFrame(data[i])
~/.local/lib/python3.8/site-packages/pandas/core/frame.py in __init__(self, data, index, columns, dtype, copy)
433 )
434 elif isinstance(data, dict):
--> 435 mgr = init_dict(data, index, columns, dtype=dtype)
436 elif isinstance(data, ma.MaskedArray):
437 import numpy.ma.mrecords as mrecords
~/.local/lib/python3.8/site-packages/pandas/core/internals/construction.py in init_dict(data, index, columns, dtype)
252 arr if not is_datetime64tz_dtype(arr) else arr.copy() for arr in arrays
253 ]
--> 254 return arrays_to_mgr(arrays, data_names, index, columns, dtype=dtype)
255
256
~/.local/lib/python3.8/site-packages/pandas/core/internals/construction.py in arrays_to_mgr(arrays, arr_names, index, columns, dtype)
62 # figure out the index, if necessary
63 if index is None:
---> 64 index = extract_index(arrays)
65 else:
66 index = ensure_index(index)
~/.local/lib/python3.8/site-packages/pandas/core/internals/construction.py in extract_index(data)
363 lengths = list(set(raw_lengths))
364 if len(lengths) > 1:
--> 365 raise ValueError("arrays must all be same length")
366
367 if have_dicts:
ValueError: arrays must all be same length
cocoa_histo can handdle it
!pip install
marche pas chez moi car j'utilise pip3 c'est con hein ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.