issues: 1474805252
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1474805252 | I_kwDOAMm_X85X574E | 7355 | Import "graphing" could not be resolvedPylance(reportMissingImports) | 107093714 | closed | 0 | 7 | 2022-12-04T13:25:13Z | 2022-12-15T12:50:31Z | 2022-12-08T13:58:19Z | NONE | What happened?Having an "AttributeError: module 'dask.array' has no attribute 'lib' " error, using the "graphing" module to create a histogram chart for data exploration. What did you expect to happen?I expected to be able to create a histogram that helps me understand my data better. Minimal Complete Verifiable Example```Python import pandas !wget https://raw.githubusercontent.com/MicrosoftDocs/mslearn-introduction-to-machine-learning/main/graphing.py !wget https://raw.githubusercontent.com/MicrosoftDocs/mslearn-introduction-to-machine-learning/main/Data/snow_objects.csv Import the data from the .csv filedataset = pandas.read_csv('snow_objects.csv', delimiter="\t") having a look at the datadataset import graphing # custom graphing code. Plot a histogram with counts for each labelgraphing.multiple_histogram(dataset, label_x="label", label_group="label", title="Label distribution") ``` MVCE confirmation
Relevant log output```PythonAttributeError Traceback (most recent call last) Input In [3], in <cell line: 1>() ----> 1 import graphing # custom graphing code. See our GitHub repo for details 3 # Plot a histogram with counts for each label 4 graphing.multiple_histogram(dataset, label_x="label", label_group="label", title="Label distribution") File /learn/graphing.py:9, in <module> 7 from numpy.core.fromnumeric import repeat, shape 8 import pandas ----> 9 import plotly.express as px 10 import plotly.io as pio 11 import plotly.graph_objects as graph_objects File /anaconda/envs/py38_default/lib/python3.8/site-packages/plotly/express/init.py:15, in <module> 9 if pd is None: 10 raise ImportError( 11 """\ 12 Plotly express requires pandas to be installed.""" 13 ) ---> 15 from ._imshow import imshow 16 from ._chart_types import ( # noqa: F401 17 scatter, 18 scatter_3d, (...) 51 density_mapbox, 52 ) 55 from ._core import ( # noqa: F401 56 set_mapbox_access_token, 57 defaults, 58 get_trendline_results, 59 NO_COLOR, 60 ) File /anaconda/envs/py38_default/lib/python3.8/site-packages/plotly/express/_imshow.py:11, in <module> 8 from plotly.utils import image_array_to_data_uri 10 try: ---> 11 import xarray 13 xarray_imported = True 14 except ImportError: File /anaconda/envs/py38_default/lib/python3.8/site-packages/xarray/init.py:1, in <module> ----> 1 from . import testing, tutorial 2 from .backends.api import ( 3 load_dataarray, 4 load_dataset, (...) 8 save_mfdataset, 9 ) 10 from .backends.rasterio_ import open_rasterio File /anaconda/envs/py38_default/lib/python3.8/site-packages/xarray/testing.py:9, in <module> 6 import numpy as np 7 import pandas as pd ----> 9 from xarray.core import duck_array_ops, formatting, utils 10 from xarray.core.dataarray import DataArray 11 from xarray.core.dataset import Dataset File /anaconda/envs/py38_default/lib/python3.8/site-packages/xarray/core/duck_array_ops.py:26, in <module> 23 from numpy import take, tensordot, transpose, unravel_index # noqa 24 from numpy import where as _where ---> 26 from . import dask_array_compat, dask_array_ops, dtypes, npcompat, nputils 27 from .nputils import nanfirst, nanlast 28 from .pycompat import cupy_array_type, dask_array_type, is_duck_dask_array File /anaconda/envs/py38_default/lib/python3.8/site-packages/xarray/core/dask_array_compat.py:60, in <module> 56 return padded 59 if da is not None: ---> 60 sliding_window_view = da.lib.stride_tricks.sliding_window_view 61 else: 62 sliding_window_view = None AttributeError: module 'dask.array' has no attribute 'lib' ``` Anything else we need to know?This link may be useful : https://raw.githubusercontent.com/MicrosoftDocs/mslearn-introduction-to-machine-learning/main/graphing.py Environment
Environment Details and Warnings
/anaconda/envs/py38_default/lib/python3.8/site-packages/scipy/__init__.py:146: UserWarning: A NumPy version >=1.16.5 and <1.23.0 is required for this version of SciPy (detected version 1.23.3
warnings.warn(f"A NumPy version >={np_minversion} and <{np_maxversion}
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/7355/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |