python3 tag

683 questions


1 answers
328 views
0
I want Python to convert all 3D lists to tuple

I would like to convert the 3D list into a tuple as shown below, but what should I do?obj1=[[[1,2],[3,4]],[[5,6],[7,8]]]obj2=(((1,2),(3,4)),((5,6),(7,8))))Thank you for your cooperation.

2 weeks ago

1 answers
311 views
0
I want to delete a combination of arrays specified in Python's three-dimensional array.

I would like to delete [[23][01][01]] which is the opposite combination of [[01][23]] in Python's three-dimensional ndarray array as shown below.import numpy as nparr1 = np.array([[0,1], [2,3]], [[...

2 weeks ago

1 answers
376 views
0
I want an event to happen when I click on a particular image on tkinter.

How do I make an event happen when I click on an image?(Viewing images on tkinter.) a=tkinter.PhotoImage(file=○○.png)  canvas.create_image(x,y,image=a)I would like to click on this image to generate a...

4 weeks ago

1 answers
242 views
0
I want to write an import statement in one line.

to distinguish Python's Pillow packages from other packages, as follows:I'd like to use it with the prefix pil, but after trying various things, I couldn't achieve it without two lines of import state...

1 months ago

1 answers
205 views
0
Determine if the values in each column are included in the text

How do I determine if the values in each column are included in the text?import pandas as pddf = pd.DataFrame( data = { 'Context': ['Clear in Tokyo', 'Cloudy Kanagawa', 'Hot Okinawa Climate', Keywor...

1 months ago

3 answers
334 views
0
I want python to expose the histogram data in the txt file to quantitative data and store it in an array.

I'm trying to create a program in Python 3 using the Jupiter Notebook.What you want to do is to read the histogram data in the txt file into an array that is dispersed into the original quantitative d...

1 months ago

1 answers
275 views
0
Error importing dtreeviz

I would like to import dtreeviz with the following code. from dtreeviz.trees import dtreevizWhen you try, you get the following error:cannot import name 'dtreeviz' from 'dtreeviz.trees'Graphviz is ins...

1 months ago

1 answers
374 views
0
Error in drawing decision tree

Execute the following code to draw the decision tree.#index extractionx_0 = df_info.resample('M') .count()x_0=x_0.drop(x_0.columns.values,axis=1)time_index=x_0.indexprint(time_index)# Draw decision tr...

1 months ago

1 answers
264 views
0
[python3] Receive Lv.1 report results / Solve problems with approaches and dictionary values

def solution(id_list, report, k): answer = [] Declareddic = {} n = len(id_list) #total number of users for x in id_list: Report dic[x] = [] for i in report: reporter = i.split() #[muzi, frodo] Repor...

2 months ago

1 answers
267 views
0
TypeError of JSON error in python: the JSON object must be str, bytes or byte array

I am thinking of reading and translating PDF and writing it out in Outlook draft.(Use the https://www.cpi-japan.com/services/ PDF file of IELTS Reading Samples at the top of this site)An error occurre...

2 months ago
- 1 - »

© 2023 OneMinuteCode. All rights reserved.