xlsx

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

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

This operation is not supported for this document – Sheets API

This operation is not supported for this document – Sheets API Question: (<class ‘googleapiclient.errors.HttpError’>, <HttpError 400 when requesting https://sheets.googleapis.com/v4/spreadsheets/1IcMY2TNLYZtGyKO_zcrhP1MudNFXbNdM/values/P%C3%A1gina1%21A%3AP?alt=json returned "This operation is not supported for this document">, <traceback object at 0x7fbb3dc3bec0>) I am getting this error message when accessing a spreadsheet in Google Sheets, I know that the error occurs because it is hosted …

Total answers: 2

Python dictionary to columns in xlsx

Python dictionary to columns in xlsx Question: I want to export a dictionary with the following format: {’66’: 74, ’62’: 32, ’69’: 18, ’72’: 14, ’64’: 37, ‘192’: 60, ’51’: 70, ’46’: 42, ‘129’: 7, ’85’: 24, ’83’: 73, ’65’: 14, ’87’: 28, ‘185’: 233, ‘171’: 7, ‘176’: 127, ’89’: 42, ’80’: 32, ‘5’: 54, …

Total answers: 5