problem: import vega_datasets.data as ...
See original GitHub issuePlease forgive me as I am a Python “newbie” and may be asking an ignorant question.
I would like to be able to use the form:
import vega_datasets.data as data
instead of
from vega_datasets import data
My motivation is that I can use something analogous to the first form when using the import()
function in the R reticulate package.
If I try this (in Python):
from vega_datasets import data
dir(data)
I get (as I expect):
['7zip',
'airports',
'anscombe',
'barley',
...
'zipcodes']
However, if I try this:
import vega_datasets.data as data2
dir(data2)
I get:
['__doc__', '__loader__', '__name__', '__package__', '__path__', '__spec__']
whereas I am hoping to replicate the first behavior.
By contrast, this works as I expect:
import scipy.stats as stats
dir(stats)
Question: could it be possible for import vega_datasets.data as data
to work like from vega_datasets import data
?
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
import_vega_data: Import Vega datasets in altair - Rdrr.io
Lets you access Vega datasets. Usage. import_vega_data(). Details. Returns the data object in the Python package vega-datasets. In the documentation for this ...
Read more >ModuleNotFoundError: No module named 'vega_datasets'
Have you tried to import these vega datasets into your script via: from vega_datasets import data. Thanks,
Read more >Vega Datasets • altair
We can access the Vega datasets using the import_vega_data() function. ... from vega_datasets import data cars = data.cars().
Read more >vega-datasets - PyPI
The main object in this library is data : >>> from vega_datasets import data. It contains attributes that access all available datasets, ...
Read more >vega_datasets: A Python Package for Datasets
has solved the dataset problem with a relatively new package called vega_datasets. ... from vega_datasets import data import pandas as pd.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Solved. Thanks, @ijlyttle.
No problem, try this: https://github.com/altair-viz/vega_datasets#installation