Skip to content
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

Code export throws syntax error #111

Closed
nielsrolf opened this issue Mar 24, 2020 · 2 comments
Closed

Code export throws syntax error #111

nielsrolf opened this issue Mar 24, 2020 · 2 comments

Comments

@nielsrolf
Copy link

nielsrolf commented Mar 24, 2020

Hi!
Executing the exported code is currently throwing a syntax error for me:

if isinstance(df, (pd.DatetimeIndex, pd.MultiIndex)):
    df = df.to_frame(index=False)

# remove any pre-existing indices for ease of use in the D-Tale code, but this is not required
df = df.reset_index().drop('index', axis=1, errors='ignore')
df.columns = [str(c) for c in df.columns]  # update columns to strings in case they are numbers

df = df.query('')

chart_data = pd.concat([
    df['date'],
    df['RPP'],
], axis=1)
chart_data = chart_data.sort_values(['date'])
chart_data.columns = ['x', 'RPP']
chart_data = chart_data.groupby('x')[['['RPP']']].sum().reset_index()
chart_data = chart_data.dropna()

Output:

  File "<ipython-input-20-c9a852059ab4>", line 16
    chart_data = chart_data.groupby('x')[['['RPP']']].sum().reset_index()
                                               ^
SyntaxError: invalid syntax
@aschonfeld
Copy link
Collaborator

@nielsrolf good catch! I'll update accordingly.

aschonfeld pushed a commit that referenced this issue Mar 28, 2020
* #84, highlight columns based on dtype
* #92, build columns with random values
* #111, code export has syntax error & str() fix for column builder names
* #116, updated styling of github fork link
* #114, added "Export CSV" link
* #113, updates to "Value Counts" chart in "Column Analysis" for number of values and ordinal entry
* #120, allowing for duplicates in bar charts
* #119, fixed bug with queries not being passed to functions
* #114, added the ability to export dataframes to CSV/TSV
* added "category breakdown" in column analysis popup for float columns
* fixed bug where previous "show missing only" selection was not being recognized
aschonfeld pushed a commit that referenced this issue Mar 28, 2020
* #84, highlight columns based on dtype
* #92, build columns with random values
* #111, code export has syntax error & str() fix for column builder names
* #116, updated styling of github fork link
* #114, added "Export CSV" link
* #113, updates to "Value Counts" chart in "Column Analysis" for number of values and ordinal entry
* #120, allowing for duplicates in bar charts
* #119, fixed bug with queries not being passed to functions
* #114, added the ability to export dataframes to CSV/TSV
* added "category breakdown" in column analysis popup for float columns
* fixed bug where previous "show missing only" selection was not being recognized
aschonfeld pushed a commit that referenced this issue Mar 28, 2020
* #84, highlight columns based on dtype
* #92, build columns with random values
* #111, code export has syntax error & str() fix for column builder names
* #116, updated styling of github fork link
* #114, added "Export CSV" link
* #113, updates to "Value Counts" chart in "Column Analysis" for number of values and ordinal entry
* #120, allowing for duplicates in bar charts
* #119, fixed bug with queries not being passed to functions
* #114, added the ability to export dataframes to CSV/TSV
* added "category breakdown" in column analysis popup for float columns
* fixed bug where previous "show missing only" selection was not being recognized
aschonfeld pushed a commit that referenced this issue Mar 28, 2020
* #84, highlight columns based on dtype
* #92, build columns with random values
* #111, code export has syntax error & str() fix for column builder names
* #116, updated styling of github fork link
* #114, added "Export CSV" link
* #113, updates to "Value Counts" chart in "Column Analysis" for number of values and ordinal entry
* #120, allowing for duplicates in bar charts
* #119, fixed bug with queries not being passed to functions
* #114, added the ability to export dataframes to CSV/TSV
* added "category breakdown" in column analysis popup for float columns
* fixed bug where previous "show missing only" selection was not being recognized
aschonfeld pushed a commit that referenced this issue Mar 28, 2020
* #84, highlight columns based on dtype
* #92, build columns with random values
* #111, code export has syntax error & str() fix for column builder names
* #116, updated styling of github fork link
* #114, added "Export CSV" link
* #113, updates to "Value Counts" chart in "Column Analysis" for number of values and ordinal entry
* #120, allowing for duplicates in bar charts
* #119, fixed bug with queries not being passed to functions
* #114, added the ability to export dataframes to CSV/TSV
* added "category breakdown" in column analysis popup for float columns
* fixed bug where previous "show missing only" selection was not being recognized
aschonfeld pushed a commit that referenced this issue Mar 28, 2020
* #84, highlight columns based on dtype
* #92, build columns with random values
* #111, code export has syntax error & str() fix for column builder names
* #116, updated styling of github fork link
* #114, added "Export CSV" link
* #113, updates to "Value Counts" chart in "Column Analysis" for number of values and ordinal entry
* #120, allowing for duplicates in bar charts
* #119, fixed bug with queries not being passed to functions
* #114, added the ability to export dataframes to CSV/TSV
* added "category breakdown" in column analysis popup for float columns
* fixed bug where previous "show missing only" selection was not being recognized
@aschonfeld
Copy link
Collaborator

fixed in v1.8.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants