python

python

python – Will the virtual environment created in the directory with the same name by venv be the same environment?

Question: Question: I'm trying to build using Windows powershell, When you create a virtual environment file with the same name in two types of files, Desktop \ file1 \ env and Desktop \ file2 \ env, file1 \ env \ Scripts \ python.exe ・ ・ ・ ① file2 \ env …

python – Will the virtual environment created in the directory with the same name by venv be the same environment? Read More »

python – Merge two DataFrame tables, aggregate data using pandas

Question: Wrote the code: array = pd.DataFrame(np.object, index=[], columns=[]) array = array.append({‘Project’: b.name, ‘Summary’: card.name, \ ‘Key’: card.id, ‘Assignee’: m, ‘Points’: s}, \ ignore_index=True) array1 = pd.read_excel(‘ProjectCostUCP.xlsx’, ‘Лист1’) result = array[[‘Project’, ‘Assignee’, ‘Points’]].groupby([‘Project’, ‘Assignee’]).sum(axis=1) print(result.columns.tolist()) result = result.merge(array1, on=[‘Project’]) result[‘Value’] = result.Points * result.Price writer = pd.ExcelWriter(‘third.xlsx’) array.to_excel(writer, “June”) result.to_excel(writer, …

python – Merge two DataFrame tables, aggregate data using pandas Read More »

python – Replacing elements in a sheet by their index starting from 1 and not 0

Question: There is a leaf list_1 = [‘a’, ‘b’, ‘c’] Values ​​should be replaced like this list_1 = [‘element_1’, ‘element_2’, ‘element_3’] Starting from 1 and not 0 I tried to do it like this list_1 = [‘element_{}’.format(i) for i in range(i+1, len(list_1))] or so list_1 = [‘element_{}’.format(i) for i in …

python – Replacing elements in a sheet by their index starting from 1 and not 0 Read More »

Scroll to Top
AllEscort