Python Forum
Search Results
Post Author Forum Replies Views Posted [asc]
    Thread: Convert Json to table format
Post: RE: Convert Json to table format

(Sep-28-2022, 08:19 AM)snippsat Wrote: Use json_normalize for this. Example. import pandas as pd lst = [ { "id": "179328741654819", "t_values": [ { "t_id": "963852456741", "value": ...
python_student General Coding Help 2 5,443 Sep-28-2022, 12:48 PM
    Thread: Convert Json to table format
Post: Convert Json to table format

I have a json as shown below and I need to convert this to table format. (all post about this did not help me and I think is because the json structure) I tried using pandas but it is not working as I...
python_student General Coding Help 2 5,443 Sep-27-2022, 07:58 PM
    Thread: Problems with my loop
Post: RE: Problems with my loop

The error happen this line: cur.execute(files)Here I read the files that have the script to insert into table that are stored in a .sql files: for i in df: <snip> i = eval(f...
python_student General Coding Help 3 1,546 Feb-17-2022, 09:40 PM
    Thread: Problems with my loop
Post: Problems with my loop

I am using pandas to read data from SQL with some specific chunksize and loading it into postgres. I am reading a files that contain the script to insert data into table. I am having problem with my l...
python_student General Coding Help 3 1,546 Feb-17-2022, 08:27 PM
    Thread: Migrating data from oracle into postgres
Post: Migrating data from oracle into postgres

I am trying to migrate data from oracle into postgres using python. My code follow bellow. def insert_postgres(): con = OracleHook(oracle_conn_id=kwargs['oracle_conn']).get_conn() cursor =...
python_student General Coding Help 1 2,424 Feb-10-2022, 08:52 PM
    Thread: Delete files from amazon s3 bucket
Post: Delete files from amazon s3 bucket

I am trying to delete all files from amazon s3 bucket before executing other tasks that will ingest data. Basically delete files before uploading new files. This is my code to delete files. It`s runni...
python_student General Coding Help 0 3,917 Jan-14-2022, 04:51 PM
  Thumbs Up Thread: Remove empty keys in a python list
Post: RE: Remove empty keys in a python list

(Jan-11-2022, 10:15 PM)deanhystad Wrote: That error trace is not for the code you posted. Your error is dictionary does not have a method named "value", it has "values". I think you can do this as...
python_student General Coding Help 7 3,012 Jan-12-2022, 10:23 PM
    Thread: Remove empty keys in a python list
Post: RE: Remove empty keys in a python list

Sorry to forget that Error:TypeError Traceback (most recent call last) <ipython-input-61-8adcda79951d> in <module> 112 payload2 = [] 113 fo...
python_student General Coding Help 7 3,012 Jan-11-2022, 07:16 PM
    Thread: Remove empty keys in a python list
Post: RE: Remove empty keys in a python list

I have tried this solution, but did not work. Here is the code I have tried. I have "if conditional" from type because I have others type. This specially is with problem print(type(a)) payload = json...
python_student General Coding Help 7 3,012 Jan-11-2022, 06:21 PM
    Thread: Remove empty keys in a python list
Post: Remove empty keys in a python list

I have a list of dictionaries and in case if some dictionary has empty key I want to remove it completely from the list. In my example, I need to remove all third block because column3 is empty. a = ...
python_student General Coding Help 7 3,012 Jan-11-2022, 05:18 PM
    Thread: TypeError: run_oracle_job() missing 1 required positional argument: 'connection_strin
Post: TypeError: run_oracle_job() missing 1 required pos...

Hi everyone. Iam trying to call connection_string method inside run_oracle_job and Im not sure if its better way to do that. Im getting this error. TypeError: run_oracle_job() missing 1 required po...
python_student General Coding Help 1 1,962 Aug-06-2021, 07:37 PM
    Thread: how to filter two fields in json using python
Post: RE: how to filter two fields in json using python

My code I posted above. All I want to do is like Where clause with and in SQL. All employees in (11,22) and active = true. I don't know the better way to do it in python
python_student General Coding Help 4 3,662 Mar-15-2021, 05:58 PM
    Thread: how to filter two fields in json using python
Post: RE: how to filter two fields in json using python

I'm not getting an error message. The Task works correctly, but it is not filtering the results I need. Returns empty json, like this [ [], [] ]
python_student General Coding Help 4 3,662 Mar-15-2021, 05:52 PM
    Thread: how to filter two fields in json using python
Post: how to filter two fields in json using python

Hi I need some help. I'm trying to filter two fieds in json but its not working. This json is from API and have a lot of pages. In first page its work very weel but when I put this same code in 'While...
python_student General Coding Help 4 3,662 Mar-15-2021, 05:25 PM

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020