Apr-24-2019, 05:27 AM
(Apr-23-2019, 03:24 PM)gontajones Wrote: You can access only some columns ofdf
using:
new_df = df[['Data.Code', 'Data.DateFrom', 'Data.Address']]
- But what about column Data.Address? There is lot of information in one column but not separetly. Instead of {'Street': 'Okružní', 'City': 'Sezimovo Ústí', 'PostCode': '39102'} I want only 2 separate columns Street and City
- And prefix of column is not only Data.xyz but for examlpe Data.snapshots.DateFrom or Data.snapshots.Address.Street etc.
- And it is not better use "df = pd_json.json_normalize" for reading and assigning to "df" only columns which I want, not all columns?
I think this part of code is necessary to modify, but I do not how
df = pd_json.json_normalize(fin, record_path=['Data','snapshots'], record_prefix = 'Data.', errors = 'ignore' )