python

Python in Linux: "ImportError: No module named X", but library exists

Python in Linux: "ImportError: No module named X", but library exists Question: I’ve recently updated a python script of mine in my server after installing Selenium. Whenever I try to execute the script: I get "ImportError Module: No module named schedule", even tho it is installed: Defaulting to user installation because normal site-packages is not …

Total answers: 1

How to change point separator for the y-axis of a Plotly figure?

How to change point separator for the y-axis of a Plotly figure? Question: I’ve been working on a graph for days to summarize some results. However, I just got stuck trying to change the y-axis separator to "," instead of "." I resorted to ChatGPT, as I don’t have that much skill with the Plotly …

Total answers: 1

Polars convert string of digits to list

Polars convert string of digits to list Question: So i have a polars column/series that is strings of digits. s = pl.Series("a", ["111","123","101"]) s shape: (3,) Series: ‘a’ [str] [ "111" "123" "101" ] I would like to convert each string into a list of integers. I have found a working solution but i am …

Total answers: 1

Polars Series.to_numpy() does not return ndarray

Polars Series.to_numpy() does not return ndarray Question: I was trying to convert a series to a numpy array via .to_numpy() but unlike what the documentation shows i am not getting a ndarray out but a seriesview Running exactly the example in the documentation: https://pola-rs.github.io/polars/py-polars/html/reference/series/api/polars.Series.to_numpy.html s = pl.Series("a", [1, 2, 3]) arr = s.to_numpy() arr type(arr) …

Total answers: 1

New to coding and i'm building a text-based game. Not sure what my issue is

New to coding and i'm building a text-based game. Not sure what my issue is Question: The game works fine, except im trying to add a restart function where the game restarts when a user inputs restart into any input. Here is my code, not sure what the issue is. # Scoring Elements # incorrect …

Total answers: 2

How can I keep both column value aligned after transposing?

How can I keep both column value aligned after transposing? Question: My Data: “`data = { ‘Col1’: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, …

Total answers: 1

subscripts in sympy and python

subscripts in sympy and python Question: I’m learning sympy and python by studying sample codes I found online. I came across this line of code z = symbols("z_{0:2}") which creates the variables z_0 and z_1. This is very handy! Now, the z_{0:2} construction reminds me of the range function in basic python. My question: Is …

Total answers: 1

plt.show() results in an empty plot figure

plt.show() results in an empty plot figure Question: plt.show() isn’t working in Matplotlib Python My Code: # Python program to show pyplot module import matplotlib.pyplot as plt from matplotlib.figure import Figure # Creating a new figure with width = 5 inches # and height = 4 inches fig = plt.figure(figsize =(5, 4)) # Creating a …

Total answers: 1

Creation of Efficient 3D Convex Hull

Creation of Efficient 3D Convex Hull Question: In the 2D convex hull problem, you are given a set of 2D points, and you must compute the smallest convex polygon containing all the given points. The problem in 3D is completely analogous. You are given 3D points, and you must compute the smallest convex polyhedron containing …

Total answers: 1