Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pandas
- pathfile = '/home/user/federative_unit.xlsx'
- df = pandas.read_excel(pathfile,converters={
- 'id':int,
- 'objectid':str,
- 'abbreviation':str,
- 'iso3166_2':str,
- 'name':str,
- 'name_unaccent':str,
- 'estimated_population':int,
- 'adjective':str,
- 'adjective_alternative':str,
- 'macroregion':str,
- 'wikipedia_pt':str,
- 'website':str
- })
- df = df.fillna('')
- for i in df.index:
- _id = df['objectid'][i].replace(' ','')
- abbreviation = (df['abbreviation'][i]).replace('"','')
- ibge_id = df['ibge_id'][i]
- iso3166_2 = df['iso3166_2'][i]
- osm_relation_id = df['osm_relation_id'][i]
- wikidata_id = df['wikidata_id'][i]
- name = df['name'][i]
- name_unaccent = df['name_unaccent'][i]
- estimated_population = df['estimated_population'][i]
- adjective = df['adjective'][i]
- adjective_alternative = df['adjective_alternative'][i]
- macroregion = df['macroregion'][i]
- wikipedia_pt = df['wikipedia_pt'][i]
- website = df['website'][i]
- timezone = df['timezone'][i]
- flag_image = df['flag_image'][i]
- country_abbreviation = df['country_abbreviation'][i]
Advertisement
Add Comment
Please, Sign In to add comment