pdeitel / introtopython Goto Github PK
View Code? Open in Web Editor NEWFiles associated with our book Intro to Python for Computer Science and Data Science
Files associated with our book Intro to Python for Computer Science and Data Science
Hello, when I enter "jupyter labextension install @jupyter-widgets/jupyterlab-manager" in the terminal on my mac, this is the response: "An error occurred. ValueError: Please install nodejs >=12.0.0 before continuing. nodejs may be installed using conda or directly from the nodejs website". I tried to solve it, but nothing doesn't work. I'm new in this world, so pls help me. Thanks to everyone who will help me.
When I ran the code:.
(base) C:\Users\me\Documents\examples\ch01>ipython RollDieDynamic.py 6000 1
The application did run but I received the following message in the terminal:
C:\Users\stste\anaconda3\Lib\site-packages\seaborn_oldcore.py:1765: FutureWarning: unique with argument that is not not a Series, Index, ExtensionArray, or np.ndarray is deprecated and will raise in a future version.
order = pd.unique(vector)
Below are the versions of Seaborn and Matplotlib installed on my system listed below:
(base) C:\Users\me\Documents\examples\ch01>conda list seaborn
seaborn 0.12.2 py311haa95532_0
(base) C:\Users\me\Documents\examples\ch01>conda list matplotlib
matplotlib 3.8.2 py311h1ea47a8_0 conda-forge
matplotlib-base 3.8.2 py311h6e989c2_0 conda-forge
matplotlib-inline 0.1.6 py311haa95532_0
Question I have and I'm just starting to learn Python. Would creating a Virtual Environment folder with the dependencies for Seaborn and Matplotlib that worked when these Live Lessons were created?
For example:
1> I created a new folder in my documents folder called "virtualenv"
2> In the terminal list all the Python versions installed on my computer py --list
3> In my list of Python installs I have version 3.9
4> To create a new virtual environment I would enter the following: py -3.9 - m venv vepy390
vepy390 is the name of the new folder created when I run the above command
Python 3.9 files will be copied to the vepy390 virtual environment folder
Run the command: vepy390\Scripts\activate
The Scripts folder would contain the dependencies (version) for the code that worked back when the Live Lessons were created.
The issue would be to download the dependencies versions that were used and worked correctly without any errors
Thank you
Hello Paul,
I'm here just to provide you a new warning message I got when using Matplotlib - a DeprecationWarning to be more specific:
REF.: Chapter 6 - RollDieDynamic.py
~/Programs/Python3/deitel/ch06/RollDieDynamic.py:34: MatplotlibDeprecationWarning: The resize_event function was deprecated in Matplotlib 3.6 and will be removed two minor releases later. Use callbacks.process('resize_event', ResizeEvent(...)) instead.
figure = plt.figure('Rolling a Six-Sided Die') # Figure for animation
~/Programs/Python3/deitel/ch06/RollDieDynamic.py:43: MatplotlibDeprecationWarning: The resize_event function was deprecated in Matplotlib 3.6 and will be removed two minor releases later. Use callbacks.process('resize_event', ResizeEvent(...)) instead.
plt.show() # display window
When trying to run it on iPython I get the following error:
File "/Users/lmeinhardt/Programs/Python3/deitel/ch01/RollDieDynamic.py", line 17, in update
axes = sns.barplot(faces, frequencies, palette='bright') # new bars
TypeError: barplot() takes from 0 to 1 positional arguments but 2 positional arguments (and 1 keyword-only argument) were given
Note: Not using anaconda installation - using the standard installation from python.org - all libraries are installed and yet I get this error.
OS: MacOS 10.16
Python: Python 3.9.12
The content of the two parameters are:
Faces: [1, 2, 3, 4, 5, 6]
Frequencies: [0, 0, 0, 1, 0, 0]
This is not really an issue but I believe this is an update to the following command:
conda install -c conda-forge ipyml
When I entered the command above I received the following:
PackagesNotFoundError: The following packages are not available from current channels:
Current channels:
To search for alternate channels that may provide the conda package you're
looking for, navigate to
https://anaconda.org
and use the search bar at the top of the page.
I went to GitHub:
https://github.com/conda-forge/ipympl-feedstock
I ran each of the 2 commands 1 by 1:
conda config --add channels conda-forge
conda install ipympl
Attached file contains the results.
If these commands are correct please let me know.
Hello,
From the video course I typed everything as perfect as it is and no matter what framework I tried to run(Jupyter-notebook,from terminal(ipython),Colab(from google) and even also tried using Pycharm I get the following error:
ValueError Traceback (most recent call last)
Input In [72], in <cell line: 30>()
27 axes.text(text_x, text_y, text, ha='center', va='bottom')
29 # read command-line arguments for number of frames and rolls per frame
---> 30 number_of_frames = int(sys.argv[1])
31 rolls_per_frame = int(sys.argv[2])
33 sns.set_style('whitegrid') # white backround with gray grid lines
ValueError: invalid literal for int() with base 10: '-f'
I just found your github now Paul and I also copied your code to my jupyter notebook and still got the same error message. What it does mean?
I generated a fresh new anaconda environment including matplotlib 3.1.1 and pyqt 5.9.2
updated_environment.yml.txt
but when I try to execute
ipython RollDieDynamic.py 6000 1
i receive the message
QApplication: invalid style override passed, ignoring it.
(Notice that no problems arise when I execute python RollDieDynamic.py 6000 1
, i.e. the python interpreter directly.
In order to correctly execute the command
ipython RollDieDynamic.py 6000 1
I need to set up a new environment with matplotlib 2.2.2 and pyqt 5.6
working_environment.yml.txt
It is advisable that a working environment is published along the code, so as to guarantee that all the examples will work without any problems.
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.