json

replace characters in a json file

replace characters in a json file Question: I’ve done some wrong manipulation of a 100 json files. Not sure what happened, but most of my json files now have a random number of the last characters repeated (as per image below). Is there a way to clean a json file by deleting characters starting from …

Total answers: 1

Converting string to a json in Python

Converting string to a json in Python Question: Im trying to convert the below string to json object using json.loads. "Error":"Execution failed on sql ‘SELECT * FROM tablename’: (‘HYT00’, ‘[HYT00] [Microsoft][ODBC Driver 17 for SQL Server]Query timeout expired (0) (SQLExecDirectW)’)" Im getting the below error. JSONDecodeError: Extra data: line 1 column 8 (char 7) How …

Total answers: 1

How to convert JSON data into JSON?

How to convert JSON data into JSON? Question: I have got an a JSON lines file: {"sample": [" Какие советы помогут вам составить успешный бизнес-план?", "n1. Изучите свой целевой рынок: поймите, кому вы продаете, насколько велика конкуренция и текущие тенденции.n2. Определите свою бизнес-модель и стратегии: решите, какие продукты и услуги вы будете предлагать и как …

Total answers: 1

Converting python dictionary value into nested keys

Converting python dictionary value into nested keys Question: I have the following dictionary: {‘expert_interests’: "[‘Machine learning’, ‘deep learning’]"} As you can see the the value of the key "expert_interests" is the String "[‘Machine learning’, ‘deep learning’]". I want to convert this string value into a nested dictionary such that the dictionary looks like this: {‘expert_interests’: …

Total answers: 2

How to parse nested JSON and load the data into a table / dataframe

How to parse nested JSON and load the data into a table / dataframe Question: I am confused how to use the json library methods and df methods. I have a json and I am trying to read it as follows: with open(json_path) as f: json_dict = json.load(f) dfs.append(pd.DataFrame([json_dict])) df = pd.concat(dfs, ignore_index=True, sort=False) display(df) …

Total answers: 1

Convert stringified json objects to json

Convert stringified json objects to json Question: I’m using MariaDB, and unfortunately, json objects are returned as strings. I want to convert these stringified json objects back to json, but the problem is – I only want to do so if they are actually json objects, and ignore all fields that are, for example, just …

Total answers: 2

Django – Can't fetch Json data in javascript

Django – Can't fetch Json data in javascript Question: Hello I am pretty new to Django and Javascript I want to build a simple application where users can write posts and see a list of all posts in reverse chronologial order on the index page. (The index page is rendered fine.) I created some Posts …

Total answers: 1

Generate SQLAlchemy models from Pydantic models

Generate SQLAlchemy models from Pydantic models Question: So I have this large JSON dataset with a huge number of properties (as well as nested objects). I have used datamodel-code-generator to build pydantic models. The JSON data has been imported into pydantic models (with nested models). Now I need to push them into the database. How …

Total answers: 1

Slice and extract specific values from JSON output

Slice and extract specific values from JSON output Question: I am querying a REST API and I need to select 2 fields from the adapter output below, the query will include multiple incident numbers. I basically need a list of Incident Numbers and Descriptions from the output below. Code to get the data: headers = …

Total answers: 2