-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
use generators and comprehensions instead of lists #1791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
6afdf59
6d2435b
f1208fa
2fb6ed4
90bb636
b6726fa
a64ab87
45a9270
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -164,9 +164,7 @@ def __init__(self, columns_or_json, fid=None): | |
| raise exceptions.InputError(err) | ||
|
|
||
| # create columns from dataframe | ||
| all_columns = [] | ||
| for name in columns_or_json.columns: | ||
| all_columns.append(Column(columns_or_json[name].tolist(), name)) | ||
| all_columns = [Column(columns_or_json[name].tolist(), name) for name in columns_or_json.columns] | ||
| self._columns = all_columns | ||
| self.id = "" | ||
|
|
||
|
|
@@ -199,9 +197,7 @@ def __init__(self, columns_or_json, fid=None): | |
| ) | ||
| # collect and sort all orders in case orders do not start | ||
| # at zero or there are jump discontinuities between them | ||
| all_orders = [] | ||
| for column_name in columns_or_json["cols"].keys(): | ||
| all_orders.append(columns_or_json["cols"][column_name]["order"]) | ||
| all_orders = [columns_or_json["cols"][column_name]["order"] for column_name in columns_or_json["cols"].keys()] | ||
|
||
| all_orders.sort() | ||
|
|
||
| # put columns in order in a list | ||
|
|
||