23
23
+ ["ids" , "error_x" , "error_x_minus" , "error_y" , "error_y_minus" , "error_z" ]
24
24
+ ["error_z_minus" , "lat" , "lon" , "locations" , "animation_group" ]
25
25
)
26
- array_attrables = ["dimensions" , "custom_data" , "hover_data" , "path" , "_column_ " ]
26
+ array_attrables = ["dimensions" , "custom_data" , "hover_data" , "path" , "wide_variable " ]
27
27
group_attrables = ["animation_frame" , "facet_row" , "facet_col" , "line_group" ]
28
28
renameable_group_attrables = [
29
29
"color" , # renamed to marker.color or line.color in infer_config
@@ -1083,7 +1083,7 @@ def process_args_into_dataframe(args, wide_mode, var_name):
1083
1083
)
1084
1084
# Check validity of column name
1085
1085
if argument not in df_input .columns :
1086
- if wide_mode and argument in ("_value_ " , var_name ):
1086
+ if wide_mode and argument in ("value " , var_name ):
1087
1087
continue
1088
1088
else :
1089
1089
err_msg = (
@@ -1154,7 +1154,7 @@ def process_args_into_dataframe(args, wide_mode, var_name):
1154
1154
pass
1155
1155
else :
1156
1156
args [field_name ][i ] = str (col_name )
1157
- if field_name != "_column_ " :
1157
+ if field_name != "wide_variable " :
1158
1158
wide_id_vars .add (str (col_name ))
1159
1159
1160
1160
for col_name in ranges :
@@ -1215,8 +1215,8 @@ def build_dataframe(args, constructor):
1215
1215
)
1216
1216
if df_provided and no_x and no_y :
1217
1217
wide_mode = True
1218
- args ["_column_ " ] = list (df_input .columns )
1219
- var_name = df_input .columns .name or "_column_ "
1218
+ args ["wide_variable " ] = list (df_input .columns )
1219
+ var_name = df_input .columns .name or "variable "
1220
1220
if constructor == go .Funnel :
1221
1221
wide_orientation = args .get ("orientation" , None ) or "h"
1222
1222
else :
@@ -1225,8 +1225,8 @@ def build_dataframe(args, constructor):
1225
1225
args ["wide_cross" ] = None
1226
1226
elif wide_x != wide_y :
1227
1227
wide_mode = True
1228
- args ["_column_ " ] = args ["y" ] if wide_y else args ["x" ]
1229
- var_name = "_column_ "
1228
+ args ["wide_variable " ] = args ["y" ] if wide_y else args ["x" ]
1229
+ var_name = "variable "
1230
1230
if constructor == go .Histogram :
1231
1231
wide_orientation = "v" if wide_x else "h"
1232
1232
else :
@@ -1272,8 +1272,8 @@ def build_dataframe(args, constructor):
1272
1272
# default and we let the normal auto-orientation-code do its thing later
1273
1273
other_dim = "x" if missing_bar_dim == "y" else "y"
1274
1274
if not _is_continuous (df_output , args [other_dim ]):
1275
- args [missing_bar_dim ] = "_count_ "
1276
- df_output ["_count_ " ] = 1
1275
+ args [missing_bar_dim ] = "count "
1276
+ df_output ["count " ] = 1
1277
1277
else :
1278
1278
# on the other hand, if the non-missing dimension is continuous, then we
1279
1279
# can use this information to override the normal auto-orientation code
@@ -1287,14 +1287,14 @@ def build_dataframe(args, constructor):
1287
1287
# at this point, `df_output` is semi-long/semi-wide, but we know which columns
1288
1288
# are which, so we melt it and reassign `args` to refer to the newly-tidy
1289
1289
# columns, keeping track of various names and manglings set up above
1290
- wide_value_vars = [c for c in args ["_column_ " ] if c not in wide_id_vars ]
1291
- del args ["_column_ " ]
1290
+ wide_value_vars = [c for c in args ["wide_variable " ] if c not in wide_id_vars ]
1291
+ del args ["wide_variable " ]
1292
1292
del args ["wide_cross" ]
1293
1293
df_output = df_output .melt (
1294
1294
id_vars = wide_id_vars ,
1295
1295
value_vars = wide_value_vars ,
1296
1296
var_name = var_name ,
1297
- value_name = "_value_ " ,
1297
+ value_name = "value " ,
1298
1298
)
1299
1299
df_output [var_name ] = df_output [var_name ].astype (str )
1300
1300
orient_v = wide_orientation == "v"
@@ -1305,24 +1305,24 @@ def build_dataframe(args, constructor):
1305
1305
1306
1306
if constructor in [go .Scatter , go .Funnel ] + hist2d_types :
1307
1307
args ["x" if orient_v else "y" ] = wide_cross_name
1308
- args ["y" if orient_v else "x" ] = "_value_ "
1308
+ args ["y" if orient_v else "x" ] = "value "
1309
1309
if constructor != go .Histogram2d :
1310
1310
args ["color" ] = args ["color" ] or var_name
1311
1311
if constructor == go .Bar :
1312
- if _is_continuous (df_output , "_value_ " ):
1312
+ if _is_continuous (df_output , "value " ):
1313
1313
args ["x" if orient_v else "y" ] = wide_cross_name
1314
- args ["y" if orient_v else "x" ] = "_value_ "
1314
+ args ["y" if orient_v else "x" ] = "value "
1315
1315
args ["color" ] = args ["color" ] or var_name
1316
1316
else :
1317
- args ["x" if orient_v else "y" ] = "_value_ "
1318
- args ["y" if orient_v else "x" ] = "_count_ "
1319
- df_output ["_count_ " ] = 1
1317
+ args ["x" if orient_v else "y" ] = "value "
1318
+ args ["y" if orient_v else "x" ] = "count "
1319
+ df_output ["count " ] = 1
1320
1320
args ["color" ] = args ["color" ] or var_name
1321
1321
if constructor in [go .Violin , go .Box ]:
1322
1322
args ["x" if orient_v else "y" ] = wide_cross_name or var_name
1323
- args ["y" if orient_v else "x" ] = "_value_ "
1323
+ args ["y" if orient_v else "x" ] = "value "
1324
1324
if constructor == go .Histogram :
1325
- args ["x" if orient_v else "y" ] = "_value_ "
1325
+ args ["x" if orient_v else "y" ] = "value "
1326
1326
args ["y" if orient_v else "x" ] = wide_cross_name
1327
1327
args ["color" ] = args ["color" ] or var_name
1328
1328
0 commit comments