hello beautiful people so i have a text file like this : user = user447 pass = 455555az type = registred date = 1 year and i want to read the file and rewrite it like this user|pass|type|date, line by line, i tried so many ways , i seem stuck since i have to deal with 1 million account Answer
Tag: python
How do I update column description in BigQuery table using python script?
I can use SchemaField(f”{field_name}”, f”{field_type}”, mode=”NULLABLE”, description=…) while making a new table. But I want to update the description of the column of the already uploaded table. Answer Unfortunately, we don’t have such a mechanism available yet to up…
“[lib] requires [dep], which is not installed” when running PR tests on conda-forge feedstock, despite explicit call in grayskull-generated meta.yaml
I’m trying to upgrade the conda-forge version of xagg to the latest version (v0.3.0). The built-in Azure Pipelines tests that run when I set up a PR of the feedstock into the conda-forge repository however fail, with the error: (the full log is here) The odd thing is that pytables is explicitly mentione…
Why do I only receive 1 row of data after converting json to dataframe in python?
My script- Out: I tried- But i only receive 1 row of data. I have about 300 rows.Why does it not capture all? Do I have to add something to the append item function? Answer Thank you, Tranbi and Joe Tha. Adding gist of conversation as a community wiki answer to help other community members. Instead of this co…
import cv2 not working in vscode but working in pycharm
I got import cv2 to work on pycharm but for some reason it does not work on my visual studio code despite doing the same thing I did with pycharm which was to pip install opencv-contrib-python on a virtual enviroment. I created a virtual enviroment in vscode and the file is part of my project file and I selec…
Inheriting name of category in Flask
I am working on budget app in Flask. Homepage give you ability to create names of Budgets and then names are transformed to links href which transfer you to another page with budget details. I want heading from /add_budget page to be inherit from budget name defined by user and it works fine until I add secon…
API Project: AttributeError: ‘list’ object has no attribute ‘id’
This is my first time working with Python and APIs. I am trying to get a list of books based on an author’s name. I’m using SQLAlchemy for this and Python 3.10.2. I think this is all the relevant code: Why am I getting this error: And how do I fix it? Answer The all() method will return you a
Raw “Insert” SQL in SQLAlchemy, Flask
Values are not added to the database after INSERT query. SELECT is working fine this way Answer you can try add ater “insert” action
AWS boto3: how to get hourly price of a specific instance id
I’m trying to write a python script using boto3 in order to get hourly prices of an instance, given the instance ID. I should remark that I’m not speaking about costs that you can get from cost explorer, I’m speaking about nominal hourly price, for example for an ‘ec2’ instance. …
Convert multiple binary columns into crosstab
I am trying to convert the following dataset which has multiple binary variables into a crosstab. into the following crosstab but i am having no luck emotion blue green red happy 2 2 2 angry 1 2 1 sad 1 1 0 Answer This is matix multiplication: Output: