question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exporting raw data in CSV

See original GitHub issue

Hi Guys,

this it perhaps rather a question than issue, Is there a way to export raw data in csv format? If I do this adata.write_csvs("filename", skip_data=False)

it works perfectly fine

but with adata.raw.write_csvs("filename", skip_data=False)

I get this error AttributeError: 'Raw' object has no attribute 'write_csvs'

Thanks,

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

12reactions
tsotnechcommented, Mar 1, 2019

@LuckyMD @maximilianh Thanks guys for your help and sorry for misunderstanding I think I wasn’t explaining correctly my issue.

So at the end this worked perfectly well to export raw data matrix

t=adata.raw.X.toarray()
pd.DataFrame(data=t, index=adata.obs_names, columns=adata.raw.var_names).to_csv('adata_raw_x.csv')
1reaction
LuckyMDcommented, Mar 1, 2019

I think I understand what you mean. The “coordinate” representation you are referring to is a sparse matrix format. If you don’t want that representation, you can densify your data using the function: adata.X.toarray(). I think you should be able to do the same with adata.X.raw as well.

Scaling removes the sparse matrix formatting, as the matrix is no longer sparse after scaling. In other words, scaling replaces (nearly) all of the 0s, so you get a dense format.

I hope that is what you’re looking for.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Downloading raw data to CSV - Export Data - QuestionPro
Downloading raw data to CSV - Export Data · Login » Surveys » Analytics » Manage Data » Export · Select CSV -...
Read more >
Raw Event Data CSV Export | Smartlook Blog
Now you can Export Events Raw Data in a .csv file. To find the export function head to the Events details and click...
Read more >
Raw Data Export - Mapp documentation
Raw data export allows you to export raw data tables to an FTP server, for example, to fill your data ... The CSV...
Read more >
Export all Raw Data as a CSV File | SampleServe Help Center
Export all Raw Data as a CSV File. Export all Raw Data as a CSV File. Russell Schindler avatar. Written by Russell Schindler...
Read more >
Export Raw Data | Adobe Commerce - Experience League
Click Manage Data > Export Data > Raw Data Export to get started. You will see an Export List of recently created data...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found