mirror of
https://github.com/dataforcanada/d4c-datapkg-statistical.git
synced 2026-10-02 20:25:47 +02:00
3.0 KiB
3.0 KiB
In [1]:
import pandas as pdIn [ ]:
tippecanoe_df_types = pd.DataFrame(da_df_cop_df.dtypes)
attributes_types = []
for row in tippecanoe_df_types.itertuples():
# This is what it should look like --attribute-type=count_total_1:int
column_name = row[0]
column_type = str(row[1])
if 'Int' in column_type:
parameter = f"--attribute-type={column_name}:int"
attributes_types.append(parameter)
elif 'Float' in column_type:
parameter = f"--attribute-type={column_name}:float"
attributes_types.append(parameter) In [2]:
print(' '.join(attributes_types))[0;31m---------------------------------------------------------------------------[0m [0;31mNameError[0m Traceback (most recent call last) Cell [0;32mIn[2], line 1[0m [0;32m----> 1[0m [38;5;28mprint[39m([38;5;124m'[39m[38;5;124m [39m[38;5;124m'[39m[38;5;241m.[39mjoin([43mattributes_types[49m)) [0;31mNameError[0m: name 'attributes_types' is not defined
In [ ]: