xlsx

pandas dataframe remove square brackets from list string when writing to xlsx

pandas dataframe remove square brackets from list string when writing to xlsx Question: First off I have referred to so many posts on this. I am following one of the approaches listed in here to remove the square brackets around Location column when writing to XLSX. But no matter what I try, I can’t get …

Total answers: 1

Converting xlsx to Google Sheets in Jupyter

Converting xlsx to Google Sheets in Jupyter Question: I’m trying to open a xlsx file from Google Drive as a Google Sheets file in Jupyter. from googleapiclient.discovery import build from google.oauth2 import service_account SERVICE_ACCOUNT_FILE = ‘gs_credentials.json’ SCOPES = [‘https://www.googleapis.com/auth/spreadsheets’] creds = None creds = service_account.Credentials.from_service_account_file( SERVICE_ACCOUNT_FILE, scopes=SCOPES) SAMPLE_SPREADSHEET_ID = ‘someidhere’ RANGE = ‘somerangehere’ service = …

Total answers: 1

openpyxl [Errno 13] permission denied when creating xlsx unless using debugger

openpyxl [Errno 13] permission denied when creating xlsx unless using debugger Question: I’m trying to write an excel file using openpyxl. I’m using PyCharm Community Edition 2021.2.3, with Python 3.8.10. When doing so, I get an exception Exception: [Errno 13] Permission denied I should precise, the file is not already opened. When I’m running the …

Total answers: 1

How to add different type of files in postgresql on Python

How to add different type of files in postgresql on Python Question: I need to add different types of files (CSV, XML, xlsx, etc.) to the database (Postgresql). I know how I can read it via pandas, but I have some issues with adding this to the database. What libraries do I need to use? …

Total answers: 1

zero-size array to reduction operation fmin which has no identity

zero-size array to reduction operation fmin which has no identity Question: I’m trying read xlsx file but gets me ValueError zero-size array to reduction operation fmin which has no identity views.py def t(request): context = {} if request.method == "POST": uploaded_file = request.FILES[‘document’] print(uploaded_file) if uploaded_file.name.endswith(‘.xlsx’): savefile = FileSystemStorage() name = savefile.save(uploaded_file.name, uploaded_file) d = …

Total answers: 1

Converting Excel-Sheet to markdown table with breaks between multiple lines in a cell

Converting Excel-Sheet to markdown table with breaks between multiple lines in a cell Question: I am writing a python script that should take a excel spreadsheet and convert it to a markdown table. Currently my code looks like this: import pandas as pd import numpy as np df = pd.read_excel(‘TestMap1.xlsx’) md_table = df.to_markdown(index=False) print(md_table) Basically …

Total answers: 1

Import yaml to excel

Import yaml to excel Question: I have following .YAML file: Name: Tom Surname: Smith Status: Married Childs: – ChildName: Willy Age: 30 Grandchild: – GrandchildName: John Age: 4 – GrandchildName: Maria Age: 3 – ChildName: Arthur Age: 40 Grandchild: N/A What I’ve done: import openpyxl import yaml with open(‘family.yaml’) as file: family_list = yaml.load(file, Loader=yaml.FullLoader) …

Total answers: 1

empty column in .toexcel() with pandas

empty column in .toexcel() with pandas Question: i use pandas for python to generate a xlsx file with two other file. i take the first one as a template, and file the column with the second file. i wrote: df_complete[‘<CLIENT>’]='<CLIENT>’ df_complete[‘Code du client *’]="C-" df_complete[‘Raison sociale *’]=df_client[‘Nom_Entreprise’].str.upper() df_complete[‘Libellé régime de TVA (Soumis à la TVA, …

Total answers: 2