Convert csv to json with python

General Tech Learning Aids/Tools 2 years ago

0 2 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Learning Aids/Tools related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (2)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

everyone, I tried to convert my csv to json, using the code below:

f = open( 'D:\\ResumesClassification\\test2.csv', 'r' )
fieldnames =("id","basicinformation","workexperience","education","skill","publication","add tionalinformation","link","award","certification")
reader = csv.DictReader( f,fieldnames)
out = json.dumps( [ row for row in reader ] )
fo = open('D:\\ResumesClassification\\test2.json','w')
fo.write(out)
fo.close()
print out

And when I used mongoimport, it said json decoder out of sync - data changing underfoot, this is how my .json look like:

[{"publication": "Structural basis for modulation of a G-protein-coupled receptor by allosteric drugs Nature,http://www.nature.com/nature/journal/v503/n7475/full/nature12595.htmlOctober 13, 2013The design of G-protein-coupled receptor (GPCR) allosteric modulators, an active area of modern pharmaceutical research, has proved challenging because neither the binding modes nor the molecular mechanisms of such drugs are known1, 2. Here we determine binding sites, bound conformations and specific drugreceptor interactions for several allosteric modulators of the M2 muscarinic acetylcholine receptor (M2 receptor), a prototypical family A GPCR, using atomic-level simulations in which the modulators spontaneously associate with the receptor. Despite substantial structural diversity, all modulators form cation interactions with clusters of aromatic residues in the receptor extracellular vestibule, approximately 15 from the classical, orthosteric ligand-binding site. We validate the observed modulator binding modes through radioligand binding experiments on receptor mutants designed, on the basis of our simulations, either to increase or to decrease modulator affinity. Simulations also revealed mechanisms that contribute to positive and negative allosteric modulation of classical ligand binding, including coupled conformational changes of the two binding sites and electrostatic interactions between ligands in these sites. These observations enabled the design of chemical modifications that substantially alter a modulators allosteric effects. Our findings thus provide a structural basis for the rational design of allosteric modulators targeting muscarinic and possibly other GPCRs.High-resolution crystal structure of human protease-activated receptor 1http://www.nature.com/nature/journal/v492/n7429/full/nature11701.htmlDecember 9, 2012Protease-activated receptor 1 (PAR1) is the prototypical member of a family of G-protein-coupled receptors that mediate cellular responses to thrombin and related proteases. Thrombin irreversibly activates PAR1 by cleaving the amino-terminal exodomain of the receptor, which exposes a tethered peptide ligand that binds the heptahelical bundle of the receptor to affect G-protein activation. Here we report the 2.2--resolution crystal structure of human PAR1 bound to vorapaxar, a PAR1 antagonist. The structure reveals an unusual mode of drug binding that explains how a small molecule binds virtually irreversibly to inhibit receptor activation by the tethered ligand of PAR1. In contrast to deep, solvent-exposed binding pockets observed in other peptide-activated G-protein-coupled receptors, the vorapaxar-binding pocket is superficial but has little surface exposed to the aqueous solvent. Protease-activated receptors are important targets for drug development. The structure reported here will aid the development of improved PAR1 antagonists and the discovery of antagonists to other members of this receptor family.Structure and dynamics of the M3 muscarinic acetylcholine receptorhttp://www.nature.com/nature/journal/v482/n7386/full/nature10867.htmlFebruary 22, 2012Acetylcholine, the first neurotransmitter to be identified, exerts many of its physiological actions via activation of a family of G-protein-coupled receptors (GPCRs) known as muscarinic acetylcholine receptors (mAChRs). Although the five mAChR subtypes (M1-M5) share a high degree of sequence homology, they show pronounced differences in G-protein coupling preference and the physiological responses they mediate. Unfortunately, despite decades of effort, no therapeutic agents endowed with clear mAChR subtype selectivity have been developed to exploit these differences. We describe here the structure of the G(q/11)-coupled M3 mAChR ('M3 receptor', from rat) bound to the bronchodilator drug tiotropium and identify the binding mode for this clinically important drug. This structure, together with that of the G(i/o)-coupled M2 receptor, offers possibilities for the design of mAChR subtype-selective ligands. Importantly, the M3 receptor structure allows a structural comparison between two members of a mammalian GPCR subfamily displaying different G-protein coupling selectivities. Furthermore, molecular dynamics simulations suggest that tiotropium binds transiently to an allosteric site en route to the binding pocket of both receptors. These simulations offer a structural view of an allosteric binding mode for an orthosteric GPCR ligand and provide additional opportunities for the design of ligands with different affinities or binding kinetics for different mAChR subtypes. Our findings not only offer insights into the structure and function of one of the most important GPCR families, but may also facilitate the design of improved therapeutics targeting these critical receptors.", "certification": "", "basicinformation": "Hillary GreenData Scientist - KnewtonNew York, NY-Authorized to work in the US for any employer", "award": "", "link": "", "workexperience": "Data ScientistKnewton - New York, NYNovember 2014 to PresentData Scientist - Embedded in Direct to Institution Team Use Big Data to advise the Direct to Institution team on how students and teachers are using the product, how to improve analytics for teachers and students, and how changes to the product might affect current users Create informative, beautiful, and dynamic data visualizations that convey key information about large data sets (javascript, d3, matplotlib) Create tools for processing, labeling, and understanding large, messy datasets (python, pandas, numpy) Write blog posts that highlight data insights to a general audience (https://www.knewton.com/blog/adaptive-learning/how-instructors-use-adaptive-assignments-in-the-classroom/https://www.knewton.com/resources/blog/adaptive-learning/visualizing-personalized-learning/https://www.knewton.com/resources/blog/adaptive-learning/friday-effect-students-really-worse/https://www.knewton.com/resources/blog/adaptive-learning/school-holidays-affect-student-scores/) Leadership: occasionally lead team stand-ups and sprint planning; advise other data scientists on best practices; review data science codeData Scientist - Efficacy Research Lead internal efficacy research efforts, including designing observational studies, performing complex data analysis, writing technical papers, and presenting results to both internal and external audiences Advise partner companies on efficacy research strategies, including study design and methodology and data analysis strategies Use Big Data to demonstrate the impact of adaptive learning technology Report research findings to internal and external audiences via papers, presentations, and visualizations(https://www.knewton.com/resources/blog/adaptive-learning/adaptive-advantage-reducing-performance-gap/)Scientific AssociateD.E. Shaw Research - New York, NYMay 2011 to November 2014Designed, performed and analyzed molecular dynamics simulations on the Anton supercomputer resulting in three publications in Nature Built tools to automate experimental workflows and report progress by email and text message using Python and shell scripting Collaborated with software engineering team to debug and suggest improvements for company-wide job-scheduler Analyzed experimental data using MATLAB and Python, including clustering (hierarchical and k-means), principal component analysis, and data visualization Studied allosteric modulation of GPCRs by drug-like molecules resulting in a completely in silico designed allosteric modulator of M2 muscarinic actylcholine receptor with novel properties Interpreted radio-ligand binding and electrophysiology data from collaborators' experiments Prepared research for publication in major journals (including manuscript writing and figure creation) Currently working on developing small-molecule inhibitors of voltage-gated potassium ion channels", "addtionalinformation": "Authored an article about life as a female scientist.http://lilith.org/blog/2014/05/for-all-you-aspiring-female-scientists-out-there/Authored a blog post on visualizing data from personalized learning (using Adobe Illustrator, iMovie, and d3 to create animations):https://www.knewton.com/resources/blog/adaptive-learning/visualizing-personalized-learning/Authored a series of blog posts on student performance at different times based on analysis of Big Data:https://www.knewton.com/resources/blog/adaptive-learning/friday-effect-students-really-worse/https://www.knewton.com/resources/blog/adaptive-learning/school-holidays-affect-student-scores/Authored a blog post on how procrastination affects student gradeshttp://www.knewton.com/blog/adaptive-learning/the-early-bird-gets-the-grade-how-procrastination-affects-student-scores/Authored a blog post about how instructors use adaptive assignments in the classroomhttp://www.knewton.com/blog/adaptive-learning/how-instructors-use-adaptive-assignments-in-the-classroom/Spoke about efficacy research at NYC Python Meetuphttp://www.meetup.com/nycpython/events/220735605/Spoke about efficacy research at PyGothamhttps://pygotham.org/2015/speakers/profile/359/", "skill": "Expert user in Python (Pandas, NumPy, SciPy, Matplotlib) (5 years), Expert user of SQL (PostgreSQL/MySQL/RedShift) (2 years), Proficient in bash shell scripting (7 years), Proficient in JavaScript (jQuery, d3) (1 year), Proficient in Unix/Linux & Windows environments (7 years), Familiar with High-Performance Computing (4 years), Expert user of Adobe Illustrator (5 years), Expert user in Maestro, VMD, PyMol (4 years), Proficient in MOE, InstantJChem (2 years), Expert user of Charmm/CGenFF force fields (4 years), Molecular Dynamics (including some Enhanced Sampling techniques, FEP) (7 years)", "education": "B.S. in Theoretical and Computational MaterialsUniversity of California, Berkeley - Berkeley, CAUniversity of California, Berkeley2006 to 2010", "id": "1"}, {"publication": "", "certification": "", "basicinformation": "Joseph DaoudNew York, NY-", "award": "", "link": "", "workexperience": "Data Scientist & Quantitative developerSocit Gnrale CIB - New York, NYSeptember 2013 to PresentNew York, USA        2013 - NowDesk Quantitative Developer & Data Scientist - Securitized Products, Exotic Credit Derivatives & Interest Rates Derivatives Designed, implemented and supported several trading pricing, monitoring and reporting tools:o    System design and data architecture for financial data repository for data sets spanning multiple asset classes and geographies(data collection, cleaning and analytics)o    Quantitative strategy: Negative Basis Trading (generated P&L of $3M in 2015): pattern recognition, opportunity triggero    Monitoring: Non-Agency MBS products financing platform (Repo, TRS on Loans, Credit Facility on ABS, CMBS, RMBS, CLO, Loans) with limitsindicators and dynamic haircut computations CMBS Primary (CRE Loans, Hedge with CMBX & IR Swaps)o    Big data: Data analysis and Machine Learning of Big Data (Fannie Mae & Freddie Mac MBS): Study of loan data analytics Statistical framework to analyze time series (generated P&L of $10M in 2015): detection of patterns, find relationships, gaininsights / 200K+ time series of 15 years / multi-asset (Rates, Credit, FX & Indices)o    Pricing: CRE Loans during warehousing period for CMBS primary market issuance Implied Spread of Markit ABX & CMBX indiceso    Market Marking: Aggregation of BWICs, price talk and enrichment of bids with market data Deal Analyzero    Risk & PnL system: Structured Products & Exotic Credit Derivativeso    Contribution: Prices and other market data in several internal systemso    Reports: Aging report, IPV report, Management risk reports, Technologies: .NET C# (+ WPF), Python, SQL. R, SAS, VBA, C++, Spark, Cassandra Methodologies: Agile Development, Continuous Delivery, Git, Jira, Build FactoryQuantitative DeveloperBanque de France - Paris (75)2012 to 2012on High Frequency Trading - Financial Economics Research Build and implemented a new, state of the art, low latency and high frequency trading simulation platform Analyzed the impact of the market making trading and the liquidity of the market Evaluated the consequences on the market functioning and dynamismFinancial Software Engineer - Global Equity DerivativesSocit Gnrale Corporate & Investment Banking - New York, NY2010 to 2011 Designed, implemented, optimized, and maintained several applications including:o    Front-end database applicationo    Real-time proprietary trade-reporting charts applicationo    File-based scheduler for report processing to external regulators (FINRA, SEC)o    Real-time and multi-threading application feeding equities database referenceo    Seeder process which aims to retrieve data from an immense reference database Wrote technical and business requirements and technical specificationsGRTGaz (via Accenture) - Paris, FranceAlgorithmic Engineer - Customer Information System upgrade (50M project) Designed and developed data processing algorithm Generated test scenarios, test cases and test data. Executed tests, created problem reports Conducted various management activities by analyzing and verifying test results, providing status reports Worked with business analysts and developers to resolve issues", "addtionalinformation": "Programming SkillsProgramming       C#, Java, C++, VBA, Python, Shell ScriptingWeb       HTML, JavaScript, AngularJSDatabases       SQL (Microsoft SQL Server, MySQL), NoSQL (MongoDB, Cassandra)Mathematics      Matlab, R, SASBig Data      Spark, Hadoop", "skill": "Microsoft office, Python, C#, spark, machine learning, Hadoop, SQL, Sql Server, VBA", "education": "MSc. in Applied Mathematics & Quantitative FinanceUniversity of Paris 1 - Paris (75)University of Paris 12011 to 2012MSc. in Computer ScienceENSISA - FranceENSISA2007 to 2010", "id": "2"}, {"publication": "", "certification": "", "basicinformation": "Jason SypniewskiData Scientist - MetisClifton, NJ-Highly motivated Data Scientist with a Bachelors Degree in Computer Science and a Masters Degree in Information Systems.  Versatile and reliable professional with a prior background in the government and defense sector.  Proven leader with experience managing cross-functional teams in high paced environments.  Creative thinker driven by data to solve real-world problems. Polished communicator with ability to effectively convey results to diverse audiences.Authorized to work in the US for any employer", "award": "Commander's Award for Civilian ServiceNovember 2015award description not metioned", "link": "http://jasonsyp.github.iohttps://www.linkedin.com/in/jasonsypniewski"
                                                
                                                
0 views
0 shares
profilepic.png
manpreet 2 years ago

I wonder why you are using DictReader. instead you can do this:

  1. read csv file line by line
  2. split it by tab or comma.
  3. create json object add each element from splitted list to json object
  4. write json object to your json file

0 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.